Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.9.0 instead.
Reason given by maintainers: Published with the wrong version number: the changes are a minor release. Use 0.8.0, which contains the same code.

ili2ogc

A pure-Python INTERLIS 2 toolkit: parses .ili models into a graph of typed Python objects (the IlisMeta16 metamodel), validates .xtf data transfers against them, and converts both to JSON Schema, SQL DDL (PostgreSQL/ GeoPackage), OGC JSON-FG, CQL2-JSON filters, and back to .xtf. TRANSLATION OF models are supported throughout via --lang (renames identifiers/keys in the output, the transfer wire format itself is unaffected).

Installation

uv sync          # or: pip install .

The generated ANTLR lexer/parser are committed under src/interlis/antlr/, so no grammar build step is needed.

Usage

interlis fetch-models model.ili transfer.xtf -o models/                 # download the models they import
interlis build model.ili --repo models/                                 # parse + print the built model
interlis validate-xtf transfer.xtf --repo models/                       # check .xtf against its .ili schema (--stream: flat memory)
interlis convert-jsonschema model.ili -o model.schema.json             # .ili -> JSON Schema
interlis convert-sql model.ili --dialect postgresql -o model.sql        # .ili -> SQL DDL
interlis import-xtf transfer.xtf --model model.ili --repo models/ -o data.sql # .xtf -> INSERTs (--stream: flat memory; an incremental transfer: POST/PUT/DELETE on an existing --dataset)
interlis convert-jsonfg transfer.xtf --repo models/ -o out.jsonfg.json   # .xtf -> OGC JSON-FG (--stream: flat memory)
interlis validate-jsonfg out.jsonfg.json --model m.ili --repo models/ # check a JSON-FG file against the model
interlis convert-cql2 model.ili -o model.cql2.json                      # CONSTRAINT -> CQL2-JSON filters
interlis convert-sld symbology.ili --sign-xtf signs.xtf -o styles/      # GRAPHIC -> OGC SLD/SE (--dpi 96 for paper-metre symbologies)
interlis write-xtf view-model.ili source.xtf -o view.xtf                # VIEW TOPIC data -> .xtf

--repo DIR (repeatable) resolves IMPORTS/schema references against a directory of .ili files; fetch-models is the only command that goes online, to fill such a directory. Run interlis <command> --help for every option. The former names convert, validate and import still work in this release and print a deprecation notice; they will be removed later.

Python API

from pathlib import Path
from interlis.runtime.parse import parse_file
from interlis.builder.model_builder import InterlisModelBuilder
from interlis.xtf.parse import parse_xtf
from interlis.xtf.validate import validate_transfer

tree, syntax_errors = parse_file(Path("model.ili"))
builder = InterlisModelBuilder(Path("mappings"), Path("spec/grammar/mapping"))
model = builder.build(tree)  # graph of Pydantic objects, e.g. model.Element[0].Name

transfer = parse_xtf(Path("transfer.xtf"))
issues = validate_transfer(transfer, symbol_table=builder.symbol_table)

interlis.convert.jsonschema/.sql/.jsonfg/.cql2/.xtf_writer expose the same conversions as the CLI's convert/convert-sql/convert-jsonfg/ convert-cql2/write-xtf. Pass a ModelRepository (interlis.builder.repository) to the builder to resolve IMPORTS against other local .ili models.

Development

uv run pytest                 # test suite
uv run ruff check src/ tests/ # lint (also enforced in CI)
uv run black src/ tests/      # format

CI (.github/workflows/ci.yml) runs ruff, black --check and the test suite on Python 3.10/3.12/3.14.

spec/grammar/mapping/*.yml and mappings/ilismeta16-*.yml (the IlisMeta16 metamodel) are the executable source of truth: InterlisModelBuilder is a generic engine driven by this data, not hand-written parsing code per grammar rule. Regenerating the vendored grammar under vendor/interlis-antlr4 is a maintainer-only step, needed only when that submodule changes.

Metadata

Release files for ili2ogc 0.7.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 ili2ogc 0.7.1
File Size Uploaded Provenance Actions
ili2ogc-0.7.1.tar.gz 384.1 kB With provenance Details for ili2ogc-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ili2ogc 0.7.1
File Interpreter ABI Platform Actions
ili2ogc-0.7.1-py3-none-any.whl Python 3 none any Details for ili2ogc-0.7.1-py3-none-any.whl

Total release size: 813.6 kB

Release files / ili2ogc-0.7.1.tar.gz

Download URL ili2ogc-0.7.1.tar.gz
Size 384.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2cebdd8a65bf80b7a603aa204c7f3ce238fa15a980ec384903377f18dd618cc2
BLAKE2b-256 checksum
How to use checksums
9e6afc18aba444bfadea9c7d2f9e04e1dccb1ac9c919e9e56d8c60022cc970ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / ili2ogc-0.7.1-py3-none-any.whl

Download URL ili2ogc-0.7.1-py3-none-any.whl
Size 429.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78542255fbde8d28dfc14fca82a843053284a5745b6ec005ffe425c89ab91969
BLAKE2b-256 checksum
How to use checksums
97a44fd87dfc666af835c8d12f3818af84c28ed4925a0d98af779d8986d027f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for ili2ogc 0.7.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ili2ogc-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

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