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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for python_vagrant_metadata-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93f9e79a5062333ae1c88df069fe3ba1ab76c63726a9794feba6276d8836b2f |
|
MD5 | bb36deaf555e7ced931516ea97c31079 |
|
BLAKE2b-256 | 26f28ea0ddb11288b526bd73cab4a9ed165c537b770b3d956c6771da72077d74 |