Skip to main content

Openquake Gem Taxonomy - Package to manage GEM Building Taxonomy strings

Project description

Python OpenQuake Gem Taxonomy

python package with GEM Building Taxonomy related class and shell commands.

Python Code

This package provide one class: GemTaxonomy

with public methods:

validate(tax_string): validate a taxonomy string and return it in a couple of useful structures

explain(tax_string, format): explain (or translate) to different formats a taxonomy string

Below a small usage example:

from openquake.gem_taxonomy import GemTaxonomy

gt = GemTaxonomy()


def validate_gem_taxonomy(value):
    try:
        gt.validate(value)
    except ValueError as e:
        print(f"Error: {e}")
        return f'{value}: {e}'


def extract_attributes(value):
        # Function to extract attributes
        attr_dict = gt.split_by_attributes(value, '|', 0, 'others')
        return attr_dict

scripts.py is another good entry-point to understand how to use GemTaxonomy class.

Console Commands

The package includes several command line tools using the python class to perform different tasks.

gem-taxonomy-validate: validate taxonomy string passed as parameter

gem-taxonomy-csv-validate: validate taxonomy strings from a csv file (or a list of them) with a lot options to replace values if needed, it is used extensively for CI pipelines

gem-taxonomy-explain: explain (or convert) taxonomy strings to different formats

gem-taxonomy-info: retrieves information about the taxonomy package and related packages

gem-taxonomy-specs2graph: create a .dot file that explains relations between atoms groups and attributes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openquake_gem_taxonomy-1.11.2.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openquake_gem_taxonomy-1.11.2-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file openquake_gem_taxonomy-1.11.2.tar.gz.

File metadata

  • Download URL: openquake_gem_taxonomy-1.11.2.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openquake_gem_taxonomy-1.11.2.tar.gz
Algorithm Hash digest
SHA256 3b86c07ff3d571866f112ee9b27338445a543b1c7546fd100377b2e3c8cda5f9
MD5 f83afbe4447d266c6a8d8d29099c6d51
BLAKE2b-256 c97a7daab82e579f529423483bd2cb6b07c7afac5a6a580d2ecf874f02f8c9b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for openquake_gem_taxonomy-1.11.2.tar.gz:

Publisher: release-to-pypi.yaml on gem/oq-gem-taxonomy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openquake_gem_taxonomy-1.11.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openquake_gem_taxonomy-1.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 418fdaa44bf71ecbf23d3ceae19d137fbe0df11b40ff41334062011e18206389
MD5 6a498403853a4dc2dcc1766ebcad7039
BLAKE2b-256 503348d40838fe4ff4348f7f26bb0b41f9998b88d6fe1b4621155b7e372d95ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for openquake_gem_taxonomy-1.11.2-py3-none-any.whl:

Publisher: release-to-pypi.yaml on gem/oq-gem-taxonomy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page