Skip to main content

Client SDK for dmstfy-extract: schema-first document extraction with generated Pydantic types

Project description

demystify-extract

Python client SDK for dmstfy-extract — schema-first document extraction with generated Pydantic v2 models for the starter schema library (invoice, bank statement, resume, contract, email).

Not yet published to PyPI. Until then, use it via the monorepo (see the module README's "Use as your own repo" section) or an editable/path install.

pip install demystify-extract      # once published — httpx + pydantic v2

What you get

  • Generated Pydantic models for each library schema version (InvoiceV1, …) that validate the API result shape, including the {raw, value} normalization envelope.
  • Envelope accessorsfield_value / field_raw / is_normalized_field.

The normalization envelope

Fields whose schema carries x-demystify-normalize: date|amount|name come back as {"raw": ..., "value": ...}. raw is the text exactly as printed; value is canonical (ISO 8601 date / integer minor units / cleaned name). Amount envelopes add currency (ISO 4217 or None) and exponent (minor-unit scale — INR/USD 2, JPY 0, BHD 3), so ¥1234{"raw": "¥1234", "value": 1234, "currency": "JPY", "exponent": 0}.

from demystify_extract.generated import InvoiceV1
from demystify_extract import field_value

invoice = InvoiceV1.model_validate(result["data"])
field_value(invoice.total_amount)  # integer minor units

Results carry a top-level result_format: "normalized@1" version tag.

See the module README for the full API, offline quickstart, and architecture.

License

MIT

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

demystify_extract-0.3.0.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

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

demystify_extract-0.3.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file demystify_extract-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for demystify_extract-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ee1dbacc3b427638e8da62535efaa684c10c948159fcac1fc9e179cd525ae377
MD5 4594b918735bcfc65ff8c7689584ba40
BLAKE2b-256 bf5a5d3da65e05914f8e33a47463d96180592ee7a2579d0b02dd0f0066bdf10b

See more details on using hashes here.

Provenance

The following attestation bundles were made for demystify_extract-0.3.0.tar.gz:

Publisher: publish-pypi.yml on demystify-systems/ai-services-tools

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

File details

Details for the file demystify_extract-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for demystify_extract-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed090f2ebb9c03469284f8e5d20fe493e9a9c49d4030b4ddc63661808b29429a
MD5 6579c4a9b9211e9bf09bfe3877ec6e54
BLAKE2b-256 e29b5d085587373e1860aedc14547458e3d3f7497ebdc7acf3ec31f0c1c258d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for demystify_extract-0.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on demystify-systems/ai-services-tools

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