Skip to content

Commit c649f66

Browse files
authored
Update README.md
1 parent 84cf0ca commit c649f66

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,24 @@ pip install pydantic-pkgr
3939
<br/>
4040

4141
```python
42-
from pydantic_pkgr import AptProvider, Binary
42+
from pydantic_pkgr import *
4343

44-
apt = AptProvider()
45-
curl = apt.install('curl')
44+
apt, brew, pip, npm, env = AptProvider(), BrewProvider(), PipProvider(), NpmProvider(), EnvProvider()
45+
46+
dependencies = [
47+
Binary(name='curl', providers=[env, apt, brew]),
48+
Binary(name='wget', providers=[env, apt, brew]),
49+
Binary(name='yt-dlp', providers=[env, apt, brew, pip]),
50+
Binary(name='playwright', providers=[env, pip, npm]),
51+
Binary(name='puppeteer', providers=[env, npm]),
52+
]
53+
for binary in dependencies:
54+
binary = binary.load_or_install()
4655

47-
print(curl.abspath, curl.version, curl.provider, curl.is_valid) # Path('/usr/bin/curl') SemVer('7.81.0') 'apt' True
56+
print(binary.abspath, binary.version, binary.provider, binary.is_valid)
57+
# Path('/usr/bin/curl') SemVer('7.81.0') 'apt' True ...
4858

49-
proc = curl.exec(['-fsSL', 'https://example.com']) # <!doctype html>...
59+
proc = Binary(name='curl').load().exec(['-fsSL', 'https://example.com']) # <!doctype html>...
5060
```
5161

5262
```python

0 commit comments

Comments
 (0)