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.12.1.tar.gz (37.9 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.12.1-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for openquake_gem_taxonomy-1.12.1.tar.gz
Algorithm Hash digest
SHA256 4a4e7bbe6e0a737a6e330f8219bb2169714a9793a77258f6d12e7dba94fdbc08
MD5 0f5d068391ca297e9392826132f43015
BLAKE2b-256 d1b430c41a9232231fc595a5ea3abcbcaab10828723cc583ea8428338e2fa669

See more details on using hashes here.

Provenance

The following attestation bundles were made for openquake_gem_taxonomy-1.12.1.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.12.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openquake_gem_taxonomy-1.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8df29e2f3ec3e42d5984c2f4439df855fa5bdfd452ab5c16a3d389642ab84b71
MD5 cc11a61836892cf289e8118fb496c0f1
BLAKE2b-256 1fc994399e136d42edd5b80c6ea55f31ed8b3c18710fb2989fdb33111e8eefd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openquake_gem_taxonomy-1.12.1-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