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.0.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.0-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openquake_gem_taxonomy-1.12.0.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.0.tar.gz
Algorithm Hash digest
SHA256 f036a98590fb882de6c527432463c2e004c8539f08aff75b448b18869475b11a
MD5 33914af1e53ba97142ac5bbd2526bc43
BLAKE2b-256 dd1a682a63e5fa07ffc401f12aee6a3250964539781103ff4356de246ebb5bf6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openquake_gem_taxonomy-1.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0c38c56488d0338bcdc2531dd64b682f8a4e4b6e58703c0a968003a14fd64b2
MD5 ca71064d3f1199fbc94ceebdf3be2b36
BLAKE2b-256 1db64757bb1d385a05e66c8f062a1906e94bbd7e1219920f0faa3ab45bf31966

See more details on using hashes here.

Provenance

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