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.3.tar.gz (36.3 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.3-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openquake_gem_taxonomy-1.11.3.tar.gz
  • Upload date:
  • Size: 36.3 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.3.tar.gz
Algorithm Hash digest
SHA256 6c42782e0b93c0ffb1072c52957b8baad7c090dab6d5d51bd675b9b9421abfd9
MD5 79b70298965ca83850a48c5f8af15fc3
BLAKE2b-256 bcd1cdcabc6d6b64bf1fac42d1465bd9dd7219ab3c031aa9d34a652de7064bcd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openquake_gem_taxonomy-1.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fd250490ef53499c8be232e71ec3124ff9e0ca3f0861cb6f50286293fed260e7
MD5 68c634066817ff138305821b9e3790fb
BLAKE2b-256 e80e9eb809bfa9d21f9f32e5f861edd4429ee67e4efa53dec6e097a7e69b66a3

See more details on using hashes here.

Provenance

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