Can use and parse metadata information of vagrant box
Project description
python-vagrant-metadata
python-vagrant-metadata is a library for download vagrant box in vagrant cloud or customs site.
import requests
from vagrant_metadata import fetch, forge_metadata_url
metadata = fetch(forge_metadata_url('ubuntu/trusty64'))
url = metadata.url_for_youngest_version('virtualbox')
response = requests.get(url)
if response.ok:
with open('mybox.box', 'wb') as f:
f.write(response.content)
If you need the checksum of box for specific versions, you can use provider as like
import requests
from vagrant_metadata import fetch, forge_metadata_url
metadata = fetch(forge_metadata_url('ubuntu/trusty64'))
url = metadata.url_for('20190514.0.0','virtualbox')
response = requests.get(url)
if response.ok:
with open('mybox.box', 'wb') as f:
f.write(response.content)
If you need the checksum of box, you can use provider as like
from vagrant_metadata import fetch, forge_metadata_url
metadata = fetch(forge_metadata_url('ubuntu/trusty64'))
provider = metadata.youngest()['virtualbox']
print(provider.url)
print(provider.checksum)
If you need the checksum of box for specific versions, you can use provider as like
from vagrant_metadata import fetch, forge_metadata_url
metadata = fetch(forge_metadata_url('ubuntu/trusty64'))
provider = metadata['20190514.0.0']['virtualbox']
print(provider.url)
print(provider.checksum)
If you want only version with the specific provider, you can filtering as like
from vagrant_metadata import fetch, forge_metadata_url
metadata = fetch(forge_metadata_url('ubuntu/trusty64'))
provider = metadata.keep_only_provider('virtualbox').youngest()['virtualbox']
print(provider.url)
print(provider.checksum)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_vagrant_metadata-0.0.3-py3-none-any.whl.
File metadata
- Download URL: python_vagrant_metadata-0.0.3-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a93f9e79a5062333ae1c88df069fe3ba1ab76c63726a9794feba6276d8836b2f
|
|
| MD5 |
bb36deaf555e7ced931516ea97c31079
|
|
| BLAKE2b-256 |
26f28ea0ddb11288b526bd73cab4a9ed165c537b770b3d956c6771da72077d74
|