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 | dsl.
a = atrep.endo("markdown", open("notes.md").read())

# A Lingvo DSL dictionary is UTF-16 (or a code page): decode it
# first, then pass the text; the result is lexigramma.
a = atrep.endo("dsl", open("webster.dsl", encoding="utf-16").read())

# Bytes in: a Word document, or a DSL file as is (decoded here).
a = atrep.endo_bytes("docx", open("report.docx", "rb").read())
a = atrep.endo_bytes("dsl", open("webster.dsl", "rb").read())

# A DSL dictionary's #INCLUDE names its abbreviations dictionary;
# pass that file's bytes too and the document opens on the
# abbreviations list (`atrep check` then reports a label it lacks).
data = open("webster.dsl", "rb").read()
name = atrep.dsl_include(data)  # "abbrev.dsl" or None
a = atrep.endo_bytes("dsl", data, abbreviations=open(name, "rb").read())

# Bytes out: a litogramma document as a Word file; `media` maps
# the enmedia parameters the document uses to their bytes.
data = atrep.exo_docx(a, media={"media/fence.png": open("fence.png", "rb").read()})
open("report.docx", "wb").write(data)

# 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.10

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.10
File Size Uploaded
atrep-0.3.10.tar.gz 19.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for atrep 0.3.10
File
atrep-0.3.10-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
atrep-0.3.10-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.10-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
atrep-0.3.10-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
atrep-0.3.10-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.5 MB

Release files / atrep-0.3.10.tar.gz

Download URL atrep-0.3.10.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c57bd0de0686821f94c569e2532d6945d26bae03faebb991ac50ba559ded5d4e
BLAKE2b-256 checksum
How to use checksums
b8b037ac99cd1039fdbb6840e8d30644f183629b36935feac3c73b1fdb2fa3c2
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 11, 2026.

Transparency log

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

Download URL atrep-0.3.10-cp39-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
181d130fe8a42269760d631dac21da81325fc3a7c9a244da8c622fd39f69f461
BLAKE2b-256 checksum
How to use checksums
d7f3cf3bfc3b3a89246d8d434b929cf580ee9821137132423fb7fe52e372af79
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 11, 2026.

Transparency log

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

Download URL atrep-0.3.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
eb10abb3eb0831c90d946c7c27afc7a43a5bd2451a0d8eeaee76e9eb0401993d
BLAKE2b-256 checksum
How to use checksums
5ffd108cf0284bbe67b518552e4f5966b9fffc171381252a1fdd236a424e905e
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 11, 2026.

Transparency log

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

Download URL atrep-0.3.10-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
47feba91eb690a564a004c7755f033b00a6ea402cb0c8e745806f8dd88c786c8
BLAKE2b-256 checksum
How to use checksums
79852cbcdac5460a771580c4802455fd8851bebfebeb096d8ece1d64fd3bd59d
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 11, 2026.

Transparency log

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

Download URL atrep-0.3.10-cp39-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0f236c3721c8dd273b915336fd205ef84680e261b05faef999a1f464eac72fd1
BLAKE2b-256 checksum
How to use checksums
f5107ff2d64aa39e9931e115657d76bf339b5b7d7f94032102705f0fd4a081ed
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 11, 2026.

Transparency log

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

Download URL atrep-0.3.10-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
bec17ba8db2a09c459a66f5ccc6f941fc66c4e0271192c849f423fcde3d36316
BLAKE2b-256 checksum
How to use checksums
670042132b8e1b20fd54b325daa58202b255bc3c0de2e3a774400d5edd87db94
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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.10 This release

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

0.3.5

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