Skip to main content

A flexible schema specification and parser for information extraction tasks.

Project description

Crates.io PyPI Build Latest Release Documentation Dependency Status Docs

Information Extraction Schema

A flexible input schema for GLiNER style multi-task models.

Python

uv add ie_schema  # or pip install
# To load from dataclasses / Pydantic models, install the optional dependency:
uv add 'ie_schema[model]'
from dataclasses import dataclass
from ie_schema import IESchema

@dataclass
class BusinessRecord:
    business_name: str
    address_line1: str
    address_line2: str | None
    email: str | None
    website: str | None
    phone: str | None

# From raw JSON (native ie-schema format):
schema = IESchema.loads(
    '{"json_structures":[{"name":"BusinessRecord","business_name":{"dtype":"str"}}]}'
)

# Or a root JSON Schema string (scalar object properties only in this conversion):
schema_from_js = IESchema.loads(
    '{"type":"object","properties":{"business_name":{"type":"string"}}}'
)

# Or pass a dataclass / Pydantic v2 model class or instance
# (requires `pydantic` — use the `model` extra):
from_schema = IESchema.loads(BusinessRecord)
from_instance = IESchema.loads(BusinessRecord("Acme", "Main", None, None, None, None))
print(schema, from_schema, from_instance)

Rust

cargo add ie-schema

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ie_schema-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (727.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

File details

Details for the file ie_schema-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: ie_schema-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 727.5 kB
  • Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ie_schema-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e53cfe3a09f08c1575c0f4aa3277480fcff906f6c0deeedd227d6364b96fe3e2
MD5 e83a8c68bcf055692af1e50c1332bf89
BLAKE2b-256 7584bec1c5bd473ae1ea24413fb8f7a14de9acbdb896ba0436f756e3d097ec34

See more details on using hashes here.

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