1212
1313** It's an ORM for your package managers, providing a nice python types for packages + installers.**
1414
15- ** This is a [ Python library] ( https://pypi.org/project/pydantic-pkgr / ) for installing & managing packages locally with a variety of package managers.**
15+ ** This is a [ Python library] ( https://pypi.org/project/abx-pkg / ) for installing & managing packages locally with a variety of package managers.**
1616It's designed for when ` requirements.txt ` isn't enough, and you have to detect or install dependencies at runtime.
1717
1818
1919``` shell
20- pip install pydantic-pkgr # will be renamed to abx-pkg soon
20+ pip install abx-pkg # will be renamed to abx-pkg soon
2121```
2222
2323
@@ -41,7 +41,7 @@ pip install pydantic-pkgr # will be renamed to abx-pkg soon
4141<br />
4242
4343``` python
44- from pydantic_pkgr import *
44+ from abx_pkg import *
4545
4646apt, brew, pip, npm, env = AptProvider(), BrewProvider(), PipProvider(), NpmProvider(), EnvProvider()
4747
@@ -63,7 +63,7 @@ for binary in dependencies:
6363
6464``` python
6565from pydantic import InstanceOf
66- from pydantic_pkgr import Binary, BinProvider, BrewProvider, EnvProvider
66+ from abx_pkg import Binary, BinProvider, BrewProvider, EnvProvider
6767
6868# you can also define binaries as classes, making them usable for type checking
6969class CurlBinary (Binary ):
@@ -77,7 +77,7 @@ curl.exec(cmd=['--version']) # curl 8.4.0
7777```
7878
7979``` python
80- from pydantic_pkgr import Binary, EnvProvider, PipProvider
80+ from abx_pkg import Binary, EnvProvider, PipProvider
8181
8282# We also provide direct package manager (aka BinProvider) APIs
8383apt = AptProvider()
@@ -115,10 +115,10 @@ print(ffmpeg.model_json_schema()) # ... OpenAPI-ready JSON schema showing all
115115## Usage
116116
117117``` bash
118- pip install pydantic-pkgr
118+ pip install abx-pkg
119119```
120120
121- ### [ ` BinProvider ` ] ( https://github.com/ArchiveBox/abx-pkg/blob/main/pydantic_pkgr /binprovider.py#:~:text=class%20BinProvider )
121+ ### [ ` BinProvider ` ] ( https://github.com/ArchiveBox/abx-pkg/blob/main/abx_pkg /binprovider.py#:~:text=class%20BinProvider )
122122
123123** Implementations: ` EnvProvider ` , ` AptProvider ` , ` BrewProvider ` , ` PipProvider ` , ` NpmProvider ` **
124124
@@ -140,7 +140,7 @@ This type represents a "provider of binaries", e.g. a package manager like `apt`
140140``` python
141141import platform
142142from typing import List
143- from pydantic_pkgr import EnvProvider, PipProvider, AptProvider, BrewProvider
143+ from abx_pkg import EnvProvider, PipProvider, AptProvider, BrewProvider
144144
145145# ## Example: Finding an existing install of bash using the system $PATH environment
146146env = EnvProvider()
@@ -166,7 +166,7 @@ print(django_bin.abspath) # Path('/usr/lib/python3.10/site-packages/
166166print (django_bin.version) # SemVer('5.0.2')
167167```
168168
169- ### [ ` Binary ` ] ( https://github.com/ArchiveBox/abx-pkg/blob/main/pydantic_pkgr /binary.py#:~:text=class%20Binary )
169+ ### [ ` Binary ` ] ( https://github.com/ArchiveBox/abx-pkg/blob/main/abx_pkg /binary.py#:~:text=class%20Binary )
170170
171171This type represents a single binary dependency aka a package (e.g. ` wget ` , ` curl ` , ` ffmpeg ` , etc.).
172172It can define one or more ` BinProvider ` s that it supports, along with overrides to customize the behavior for each.
@@ -180,7 +180,7 @@ It can define one or more `BinProvider`s that it supports, along with overrides
180180- ` sha256: str `
181181
182182``` python
183- from pydantic_pkgr import BinProvider, Binary, BinProviderName, BinName, ProviderLookupDict, SemVer
183+ from abx_pkg import BinProvider, Binary, BinProviderName, BinName, ProviderLookupDict, SemVer
184184
185185class CustomBrewProvider (BrewProvider ):
186186 name: str = ' custom_brew'
@@ -215,7 +215,7 @@ print(ytdlp.is_valid) # True
215215```
216216
217217``` python
218- from pydantic_pkgr import BinProvider, Binary, BinProviderName, BinName, ProviderLookupDict, SemVer
218+ from abx_pkg import BinProvider, Binary, BinProviderName, BinName, ProviderLookupDict, SemVer
219219
220220# ### Example: Create a binary that uses Podman if available, or Docker otherwise
221221class DockerBinary (Binary ):
@@ -255,10 +255,10 @@ print(custom_docker.version) # SemVer('5.0.2')
255255print (custom_docker.is_valid) # True
256256```
257257
258- ### [ ` SemVer ` ] ( https://github.com/ArchiveBox/abx-pkg/blob/main/pydantic_pkgr /semver.py#:~:text=class%20SemVer )
258+ ### [ ` SemVer ` ] ( https://github.com/ArchiveBox/abx-pkg/blob/main/abx_pkg /semver.py#:~:text=class%20SemVer )
259259
260260``` python
261- from pydantic_pkgr import SemVer
261+ from abx_pkg import SemVer
262262
263263# ## Example: Use the SemVer type directly for parsing & verifying version strings
264264SemVer.parse(' Google Chrome 124.0.6367.208+beta_234. 234.234.123' ) # SemVer(124, 0, 6367')
@@ -290,7 +290,7 @@ With a few more packages, you get type-checked Django fields & forms that suppor
290290> - [`django- admin- data- views` ](https:// github.com/ MrThearMan/ django- admin- data- views)
291291> - [`django- pydantic- field` ](https:// github.com/ surenkov/ django- pydantic- field)
292292> - [`django- jsonform` ](https:// django- jsonform.readthedocs.io/ )
293- > `pip install pydantic - pkgr django- admin- data- views django- pydantic- field django- jsonform`
293+ > `pip install abx - pkg django- admin- data- views django- pydantic- field django- jsonform`
294294
295295< br/ >
296296
@@ -307,7 +307,7 @@ Example Django `models.py` showing how to store `Binary` and `BinProvider` insta
307307from typing import List
308308from django.db import models
309309from pydantic import InstanceOf
310- from pydantic_pkgr import BinProvider, Binary, SemVer
310+ from abx_pkg import BinProvider, Binary, SemVer
311311from django_pydantic_field import SchemaField
312312
313313class InstalledBinary(models.Model):
@@ -349,7 +349,7 @@ obj.binary.exec(['--version']) # curl 7.81.0 (x86_64-apple-
349349< img height = " 220" alt = " Django Admin binaries list view" src = " https://github.com/ArchiveBox/abx-pkg/assets/511499/a9980217-f39e-434e-b266-20cd6feb17c3" align = " top" >< img height = " 220" alt = " Django Admin binaries detail view" src = " https://github.com/ArchiveBox/abx-pkg/assets/511499/d4d9086e-c8f4-4b6e-8ee8-8c8a864715b0" align = " top" >
350350
351351```bash
352- pip install pydantic - pkgr django- admin- data- views
352+ pip install abx - pkg django- admin- data- views
353353```
354354* For more info see the [`django- admin- data- views` ](https:// github.com/ MrThearMan/ django- admin- data- views) docs... *
355355
@@ -358,24 +358,24 @@ Then add this to your `settings.py`:
358358INSTALLED_APPS = [
359359 # ...
360360 ' admin_data_views'
361- ' pydantic_pkgr '
361+ ' abx_pkg '
362362 # ...
363363]
364364
365365# point these to a function that gets the list of all binaries / a single binary
366- PYDANTIC_PKGR_GET_ALL_BINARIES = ' pydantic_pkgr .views.get_all_binaries'
367- PYDANTIC_PKGR_GET_BINARY = ' pydantic_pkgr .views.get_binary'
366+ ABX_PKG_GET_ALL_BINARIES = ' abx_pkg .views.get_all_binaries'
367+ ABX_PKG_GET_BINARY = ' abx_pkg .views.get_binary'
368368
369369ADMIN_DATA_VIEWS = {
370370 " NAME" : " Environment" ,
371371 " URLS" : [
372372 {
373373 " route" : " binaries/" ,
374- " view" : " pydantic_pkgr .views.binaries_list_view" ,
374+ " view" : " abx_pkg .views.binaries_list_view" ,
375375 " name" : " binaries" ,
376376 " items" : {
377377 " route" : " <str:key>/" ,
378- " view" : " pydantic_pkgr .views.binary_detail_view" ,
378+ " view" : " abx_pkg .views.binary_detail_view" ,
379379 " name" : " binary" ,
380380 },
381381 },
@@ -398,7 +398,7 @@ class YourSiteAdmin(admin.AdminSite):
398398custom_admin = YourSiteAdmin()
399399custom_admin.register(get_user_model())
400400...
401- from pydantic_pkgr .admin import register_admin_views
401+ from abx_pkg .admin import register_admin_views
402402register_admin_views(custom_admin)
403403< / code>< / pre>
404404< / details>
@@ -453,7 +453,7 @@ admin.site.register(MyModel, MyModelAdmin)
453453```python
454454from subprocess import run, PIPE
455455
456- from pydantic_pkgr import BinProvider, BinProviderName, BinName, SemVer
456+ from abx_pkg import BinProvider, BinProviderName, BinName, SemVer
457457
458458class CargoProvider(BinProvider):
459459 name: BinProviderName = ' cargo'
@@ -514,17 +514,17 @@ print(rg.version) # SemVer(14, 1, 0)
514514
515515[coverage- badge]: https:// coveralls.io/ repos/ github/ ArchiveBox/ abx- pkg/ badge.svg? branch = main
516516[status- badge]: https:// img.shields.io/ github/ actions/ workflow/ status/ ArchiveBox/ abx- pkg/ test.yml? branch = main
517- [pypi- badge]: https:// img.shields.io/ pypi/ v/ pydantic - pkgr ? v = 1
517+ [pypi- badge]: https:// img.shields.io/ pypi/ v/ abx - pkg ? v = 1
518518[licence- badge]: https:// img.shields.io/ github/ license / ArchiveBox/ abx- pkg? v = 1
519519[repo- badge]: https:// img.shields.io/ github/ last- commit/ ArchiveBox/ abx- pkg? v = 1
520520[issues- badge]: https:// img.shields.io/ github/ issues- raw/ ArchiveBox/ abx- pkg? v = 1
521- [version- badge]: https:// img.shields.io/ pypi/ pyversions/ pydantic - pkgr ? v = 1
522- [downloads- badge]: https:// img.shields.io/ pypi/ dm/ pydantic - pkgr ? v = 1
523- [django- badge]: https:// img.shields.io/ pypi/ djversions/ pydantic - pkgr ? v = 1
521+ [version- badge]: https:// img.shields.io/ pypi/ pyversions/ abx - pkg ? v = 1
522+ [downloads- badge]: https:// img.shields.io/ pypi/ dm/ abx - pkg ? v = 1
523+ [django- badge]: https:// img.shields.io/ pypi/ djversions/ abx - pkg ? v = 1
524524
525525[coverage]: https:// coveralls.io/ github/ ArchiveBox/ abx- pkg? branch = main
526526[status]: https:// github.com/ ArchiveBox/ abx- pkg/ actions/ workflows/ test.yml
527- [pypi]: https:// pypi.org/ project/ pydantic - pkgr
527+ [pypi]: https:// pypi.org/ project/ abx - pkg
528528[licence]: https:// github.com/ ArchiveBox/ abx- pkg/ blob/ main/ LICENSE
529529[repo]: https:// github.com/ ArchiveBox/ abx- pkg/ commits/ main
530530[issues]: https:// github.com/ ArchiveBox/ abx- pkg/ issues
0 commit comments