Skip to main content

Validazione formale locale dei Codici Unici di Progetto (CUP).

Project description

cup-check

Libreria Python per validare localmente il formato dei Codici Unici di Progetto (CUP).

La verifica e solo formale: un CUP con formato valido viene restituito come FORMATO_VALIDO_DA_VERIFICARE, non come CUP esistente.

from cup_check import validate_format

result = validate_format("G17H03000130001")

print(result.outcome)
print(result.failed_rules)

Per validare piu valori:

from cup_check import validate_many

results = validate_many(["G17H03000130001", "117H03000130001"])

Da 0.3.0, il package include anche il contratto tipizzato per leggere il dataset-manifest.json delle release OpenCUP self-hosted:

from cup_check import load_dataset_manifest

manifest = load_dataset_manifest("dataset-manifest.json")
print(manifest.dataset_tag)
print(manifest.chunks.files)

Per verificare la presenza nel perimetro OpenCUP con un indice SQLite locale:

from cup_check import OpenCupChecker

with OpenCupChecker.from_manifest(
    "dataset-manifest.json",
    sqlite_path="cup-index.sqlite",
) as checker:
    result = checker.check("G17H03000130001")

print(result.outcome)

Per usare l'ultimo dataset pubblicato con cache locale:

from cup_check import OpenCupChecker

checker = OpenCupChecker.from_latest(cache_dir=".cup-check-cache")
result = checker.check("G17H03000130001")

Se il dataset non e disponibile, il checker resta cautelativo e restituisce FORMATO_VALIDO_DA_VERIFICARE per i CUP formalmente validi.

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

cup_check-0.3.2.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

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

cup_check-0.3.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file cup_check-0.3.2.tar.gz.

File metadata

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

File hashes

Hashes for cup_check-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b2e0e892162516351587ef46048114cda06fb26ee76af449d5cd8ff0158e77d2
MD5 0392ca5f8d2bd4bf1dfb354bb6a4c405
BLAKE2b-256 33aace7990605e141369ad889a9146264d3f4ffc1f1fafbcc57a2bc7fe5ff2fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for cup_check-0.3.2.tar.gz:

Publisher: release-python.yml on ale-saglia/cup-check

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

File details

Details for the file cup_check-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: cup_check-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cup_check-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fab659a25f9980e8b32b7f8f219977c87bb77c1850f34eff17b3c4a211a60003
MD5 e692f8473313e581847207b7af03869d
BLAKE2b-256 96d4675585d88e55b790f6b96435fe0f39eb098d3dea8d8330206ffaa1f02f25

See more details on using hashes here.

Provenance

The following attestation bundles were made for cup_check-0.3.2-py3-none-any.whl:

Publisher: release-python.yml on ale-saglia/cup-check

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