Skip to main content

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)

Build package

python3 setup.py bdist_wheel
python3 -m twine upload --skip-existing --repository testpypi dist/*
python3 -m pip install --index-url https://test.pypi.org/simple/ python-vagrant-metadata

Metadata

Release files for python-vagrant-metadata 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-vagrant-metadata 0.0.5
File Size Uploaded
python-vagrant-metadata-0.0.5.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-vagrant-metadata 0.0.5
File Interpreter ABI Platform
python_vagrant_metadata-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / python-vagrant-metadata-0.0.5.tar.gz

Download URL python-vagrant-metadata-0.0.5.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
98c4355ce7f026c5d9ddd9aa58b249b2e83ab41d2d96a85bc7be7314569426b2
BLAKE2b-256 checksum
How to use checksums
47c923c16e69ea67c5efe423da79deb12b33a115054cf4d372c1e90f4dd59f4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / python_vagrant_metadata-0.0.5-py3-none-any.whl

Download URL python_vagrant_metadata-0.0.5-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67abf8d5b53a6185c111d3dcaa11e39ced6b3d4e57204821652ce96362e878c9
BLAKE2b-256 checksum
How to use checksums
c80cf3635d6d2e0a27dfaf787925a36c1911a865f063cf0284caa58cece790fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page