Skip to main content

atrep — Python bindings

Python bindings for atrep, an extensible semantic markup language designed with literary applications in mind. The same Rust core the CLI wraps (atrep on crates.io), surfaced pythonically: strings in, strings out, exceptions instead of exit codes.

pip install atrep

Checking and the two spellings

import atrep

doc = open("apology.atd").read()

# Parse and validate; routes on the declaration.
atrep.check(doc)          # -> "document" | "dialektos"

# The two spellings: brachygraphic (sim symbols; canonical)
# and plerographic (sim names in braces). Both parse to the
# identical structure.
names = atrep.plero(doc)              # @# ... -> @{section} ...
symbols = atrep.brachy(names)         # ... and back
localized = atrep.plero(doc, lang="el")   # glossa sim names

The structural outline

o = atrep.outline(doc)
o["dialektos"]    # "litogramma"
o["blocks"]       # [{"kind", "symbol", "name", "depth",
                  #   "start", "end", "lemma", "onym",
                  #   "genoses"}, ...]
o["milestones"]   # [{"key": "steph:17a", "line": 4}, ...]
o["onyms"]        # located onym anchors
o["deixes"]       # located deixis references

Endo importers

# Foreign formats -> canonical atrep: markdown | html | rst |
# org | djot | docbook | bibtex | jats | tei | usfm | usx | osis |
# fb2 | rnc | opencorpora | proiel | conllu.
a = atrep.endo("markdown", open("notes.md").read())

# Versification milestone scheme (usfm/usx/osis only).
a = atrep.endo("usfm", open("john.usfm").read(), scheme="std")

Dialektoi

# Resolve a dialektos and get its canonical serialization.
# The std dialektoi are embedded; `dir` resolves from disk,
# `sources` from in-memory artifacts.
lekt = atrep.dialektos("koine")
lekt = atrep.dialektos("demo", sources={"demo.lektos": dia})
atrep.std_dialektoi()   # ["at-djot", "koine", ..., "litogramma"]

Errors raise atrep.AtrepError, with file:line:col locations in the message where the source provides them. atrep.version() reports the bindings/core version.

Resolution is offline: non-std dialektoi resolve from the directory of the path argument (default doc.atd, i.e. the process working directory). Remote fetching (kanonizo) and the multi-document operations (morphisms, exo rendering, collation) belong to the CLI.

License

MIT or Apache-2.0, at your option.

Metadata

Release files for atrep 0.3.5

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

Source distribution (sdist)

Source distribution for atrep 0.3.5
File Size Uploaded
atrep-0.3.5.tar.gz 16.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for atrep 0.3.5
File
atrep-0.3.5-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
atrep-0.3.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
atrep-0.3.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
atrep-0.3.5-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
atrep-0.3.5-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 3.9 MB

Release files / atrep-0.3.5.tar.gz

Download URL atrep-0.3.5.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d772e0dbf7f7e40bdadf0bb50df5474b54353913343c0d1819b60e4ac0157854
BLAKE2b-256 checksum
How to use checksums
0fd28826e88005da2d6c9687ee6641448b0e7ab5009669b8566183a8f69c8d92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / atrep-0.3.5-cp39-abi3-win_amd64.whl

Download URL atrep-0.3.5-cp39-abi3-win_amd64.whl
Size 765.4 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ea15323d3c8c23ebe80a3cf4b22dbf09e99acdfe6e4a4dbc70c59e927f0a3539
BLAKE2b-256 checksum
How to use checksums
1a59b8c9d9f8f67585438dcafb0f2924893b0e816011bc8ef6a45774186f96ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / atrep-0.3.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL atrep-0.3.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 823.4 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
48f2ff247036b4a98921eb917cd1df8b2066c9e27434becae4fb4175726c8a12
BLAKE2b-256 checksum
How to use checksums
9f841f00ff313093a99899a0870e3d6bc0d76a54fdc0080d7fb86be8cafa9ba8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / atrep-0.3.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL atrep-0.3.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 762.8 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
8b2e1128c2aa8227b113d001cea3ff319e926c76318e20d2d527b4b382ce8dd0
BLAKE2b-256 checksum
How to use checksums
149a1caf143f4c3099f2bffd1fb840c5432f5c0703e191243d67c156eb27f2d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / atrep-0.3.5-cp39-abi3-macosx_11_0_arm64.whl

Download URL atrep-0.3.5-cp39-abi3-macosx_11_0_arm64.whl
Size 738.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2d18f37ebddaa6b4414bc1e3a7e23362a75c33979953b77c0a4b73017445e96f
BLAKE2b-256 checksum
How to use checksums
421112dcdd32132c973d94c8d7457a23d521e788e38a7c74c71d51f50d1568f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release files / atrep-0.3.5-cp39-abi3-macosx_10_12_x86_64.whl

Download URL atrep-0.3.5-cp39-abi3-macosx_10_12_x86_64.whl
Size 764.0 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
66e593162df88d6617ad3d9daf8f8241244ba83fac1effdfc4e3674fd99d5987
BLAKE2b-256 checksum
How to use checksums
202bf1744809a903dd71e91763d84b5c4bd838b3cff29ce878c4602b8a6d2189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.10

6 release files

0.3.9

6 release files

0.3.8

6 release files

0.3.7

6 release files

0.3.6

6 release files

This release

0.3.5 This release

6 release files

0.3.4

6 release files

0.3.3

6 release files

0.3.1

6 release files

0.3.0

6 release files

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