Skip to main content

neverblink-linkml

Fast and robust LinkML schema validation and code generation for Python, backed by ohi LinkML compiled to a native shared library.

Install

pip install neverblink-linkml

Usage

import ohi_linkml

with ohi_linkml.load_file("model.yaml") as schema:
    print(schema.json_schema())
    print(schema.shacl())
    for issue in schema.issues(ohi_linkml.WARNING):
        print(issue["severity"], issue["message"])

load_file() will automatically resolve imports and parse the schema. You can reuse the Schema object for multiple generator calls, and it will automatically cache the parsed form of any imported schemas.

Generators available on a Schema: json_schema(), shacl(), rdfs(), linkml(), frictionless(), graphql(), typescript(), pydantic(), er_diagram(), docs(), translation(), ossie(), owl(), scala() and stats(), plus lint() for validation. For how to use the classes pydantic() generates, see the Pydantic guide.

Going the other way, ohi_linkml.from_ossie() reads an Apache Ossie (incubating) ontology, and ohi_linkml.from_owl() an OWL ontology in Turtle or N-Triples. Each returns a dict with the corresponding LinkML schema, and warnings about what it could not import.

To work from memory instead of the file system, use load_string() for a single schema or load_path() when imports are involved:

schema = ohi_linkml.load_path("model.yaml", {
    "model.yaml": "...",
    "person.yaml": "...",  # referenced via `imports: - person`
})

To load an import from another location without changing the schema, pass import_map=, a mapping or the path of a JSON file:

schema = ohi_linkml.load_file(
    "model.yaml",
    import_map={"https://example.org/units/": "deps/units/"},
)
schema = ohi_linkml.load_file("model.yaml", import_map="imports.json")

See Import maps.

Supported platforms

We provide both sdist (source distribution) and pre-built wheels for popular platforms (Linux, macOS, Windows, x86-64 and ARM64).

To build the package from source (sdist) you must have Java 17+ and Clang installed on your system. Please open an issue if you encounter any issues with the installation process.

Documentation

License

Apache 2.0.

Metadata

Release files for neverblink-linkml 0.18.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neverblink-linkml 0.18.1
File Size Uploaded Provenance Actions
neverblink_linkml-0.18.1.tar.gz 67.3 MB With provenance Details for neverblink_linkml-0.18.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for neverblink-linkml 0.18.1
File Actions
neverblink_linkml-0.18.1-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for neverblink_linkml-0.18.1-py3-none-win_arm64.whl
neverblink_linkml-0.18.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for neverblink_linkml-0.18.1-py3-none-win_amd64.whl
neverblink_linkml-0.18.1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for neverblink_linkml-0.18.1-py3-none-musllinux_1_2_x86_64.whl
neverblink_linkml-0.18.1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for neverblink_linkml-0.18.1-py3-none-musllinux_1_2_aarch64.whl
neverblink_linkml-0.18.1-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for neverblink_linkml-0.18.1-py3-none-manylinux_2_17_x86_64.whl
neverblink_linkml-0.18.1-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for neverblink_linkml-0.18.1-py3-none-manylinux_2_17_aarch64.whl
neverblink_linkml-0.18.1-py3-none-macosx_14_0_x86_64.whl Python 3 none macOS 14.0+ x86-64 Details for neverblink_linkml-0.18.1-py3-none-macosx_14_0_x86_64.whl
neverblink_linkml-0.18.1-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details for neverblink_linkml-0.18.1-py3-none-macosx_14_0_arm64.whl

Total release size: 99.2 MB

Security for neverblink-linkml 0.18.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page