Skip to main content

ENVRI Hub's VRE Library

PyPI - License PyPI - Downloads Pepy Total Downloads

This is the official ENVRI-Hub Python library, its purpose is to streamline interaction with the ENVRI-Hub APIs, providing a pythonic facade to data and service access.

Quickstart

After installing the package with a quick

pip install envrihub

You can start using the ENVRI-HUB resorces right away through the Hub object:

from envrihub import Hub

hub = Hub()

You can query it to retrieve resources that match your needs:

for res in hub.search_catalogue('bacon'):
    print(res.title)

You can specify free text queries, time boundaries, geographic boundaries, data providers and/or variables you expect in your data. Here is an example of geographical search with a WKT polygon:

geography = 'POLYGON((10.70 48.34,
                28.98 48.34
                28.98 36.17,
                10.70 36.17,
                10.70 48.34))'

for i in hub.search_catalogue(geography = geography):
    print(i.title)

Just type help(hub.seach_catalogue) for the full details.

You can also access a resurce directly if you know its unique identifier in the Catalogue of Services:

res = hub.fetch_from_catalogue('https://doi.org/10.14284/wormswebservice_distRecByVernacular')

Retrieved resources have the following properties:

  • title: a human readable title for the resource;
  • uid: the resource's identifier in the Catalogue of Services;
  • description: a human readable description of the resource;
  • metadata: the whole EPOS-DCAT-AP metadata of the resource;
  • dao: the data access object that allows you to get the actual data. All DAOs have an access method.

DAO objects are auto-generated according to the resource's metadata and can have additional methods to access data, when in doubt check them out with the help function:

help(res.dao)

If the resource is a Web Service, the DAO object allows to query such a service with all due parameters:

res = hub.fetch_from_catalogue('https://doi.org/10.14284/wormswebservice_distDistByAphiaId')
res.dao.access(id='138228')

Or if the resource is a static file it lets you download it either as a bytes object or directly to your file system.

res = hub.fetch_from_catalogue('file:///software/notebook/1107/Dataset/001/seadatanet88/Distribution/001')
byte_stream = res.dao.access() # bytes object
res.dao.download('path-to.file') # local file download

Digital kleptomaniacs rejoice! This means that with a handful of lines you can now scrape the whole ENVRI-HUB!

for res in hub.search_catalogue():
    if res.is_downloadable():
        res.dao.download(res.id)

for more working examples data access check out the ENVRI-HUB notebooks.

Contributing

To contribute, you have to attend ENVRI-Hub Next's WP14 monthly meetings. For now, if we never saw you, your pull requests will be rejected.

Acknowledgements

This project is funded by the ENVRI-Hub Next project. The project received funding from the European Union’s Horizon Europe research and innovation programme under grant agreement No 101131141.

Metadata

Release files for envrihub 0.1.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 envrihub 0.1.5
File Size Uploaded Provenance Actions
envrihub-0.1.5.tar.gz 26.5 kB Without provenance Details for envrihub-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for envrihub 0.1.5
File Interpreter ABI Platform Actions
envrihub-0.1.5-py3-none-any.whl Python 3 none any Details for envrihub-0.1.5-py3-none-any.whl

Total release size: 54.8 kB

Release files / envrihub-0.1.5.tar.gz

Download URL envrihub-0.1.5.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
db0971e46254a5e9bf2423305c0918553343019f9ff51380394d2fa4894bf796
BLAKE2b-256 checksum
How to use checksums
cdd2ea69cb8ba3eaf0c0ce7d4a0828e3da8af00386733ec65611ef7c190191d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / envrihub-0.1.5-py3-none-any.whl

Download URL envrihub-0.1.5-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d944241d315e33a074b33990bb37beef7b418dab1ef4ccd18fa322da0f54f76
BLAKE2b-256 checksum
How to use checksums
c34a94ca7a4bef47f4d347efc87944d9d9ac233e7abd5431ea4cbdc0d1c039d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for envrihub 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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