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.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (721.0 kB view details)

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

File details

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

File metadata

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

File hashes

Hashes for ie_schema-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe2810a33d9e166013def039255f77159f468f35a13a88e7da99c4958e46b91b
MD5 ab50bc502c9d18d3a98b8ddebbb416f5
BLAKE2b-256 be99343e7aec5e9e19cd8d306773d986f7476577b69e2d06fbf9e1d41c67a916

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