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.2.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.2.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: demystify_extract-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 34b2057ac7748781c615a499bdcd2fad5dd0d983b365251f51a5e71e8100a8af
MD5 5af2635e189f34b61cc2aa46de3e0101
BLAKE2b-256 eb17b9896bbd2ae5752b0131ac715131853bc539e7f7d4f91bfb736fba534eb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for demystify_extract-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for demystify_extract-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f49a1eb82e52d4f419580f8bb07eeb12a719cdcaf5df0f03d7d8cb35976be50
MD5 4adbdaf3e9de79dba1d3db2d0fbf3180
BLAKE2b-256 ec40563bc3db3edb3b4db2dac93e70705bc1ff99f38ce07f236a4fefee10f958

See more details on using hashes here.

Provenance

The following attestation bundles were made for demystify_extract-0.2.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