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.4

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.4
File Size Uploaded
atrep-0.3.4.tar.gz 15.8 kB Details

Built distributions (wheels)

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

Total release size: 3.8 MB

Release files / atrep-0.3.4.tar.gz

Download URL atrep-0.3.4.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
81d4814933fe3a9c83f05ae43e011beaf8a4754f454ba3d7b14e3a000889bf6c
BLAKE2b-256 checksum
How to use checksums
a6628f92808023015d026f9c4a41b42b60bf0059fb8c76795b434ac28e80bc53
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 1, 2026.

Transparency log

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

Download URL atrep-0.3.4-cp39-abi3-win_amd64.whl
Size 755.2 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
29c64b4c0850b76a4c709ff912dacaf07b22f47d119f809f241bcf1c8baad3d7
BLAKE2b-256 checksum
How to use checksums
008a91729c52e4e436bcc92d5a58961cd885450f6e567b71f5d6848ff5e80955
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 1, 2026.

Transparency log

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

Download URL atrep-0.3.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 814.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0f705fa077de272b7c21a7d90bf627e35bcc2f873e8b0dfb2efbf327aa57f36b
BLAKE2b-256 checksum
How to use checksums
d8cb5dfea36c4972cb48c87324086950422d3432b9f6160f76a48722e8ea269e
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 1, 2026.

Transparency log

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

Download URL atrep-0.3.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 755.6 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ddb455d0ba2bc99b6ce0b99dfe3591ee8687124f13537444e902952f2deb1d21
BLAKE2b-256 checksum
How to use checksums
af2414e1aee323378fe14775c337cd1521fe0ebc5762f33dfb13612def426696
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 1, 2026.

Transparency log

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

Download URL atrep-0.3.4-cp39-abi3-macosx_11_0_arm64.whl
Size 730.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
68e83091144ec75ee4f099350d81cce29c817a5077a647dab94e4eca4b8520a0
BLAKE2b-256 checksum
How to use checksums
c95129b6e3e17c941be08596925584e838fb4e8d194f1f898a09cae8927183e2
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 1, 2026.

Transparency log

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

Download URL atrep-0.3.4-cp39-abi3-macosx_10_12_x86_64.whl
Size 756.5 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c21fc55ec018e672edc1ade64953b6912191185215bc81dd1f9baa8ce838e25b
BLAKE2b-256 checksum
How to use checksums
046aca28184749b444ee695851344cef9333a1b9869476c4dd01da67aa701328
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 1, 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

0.3.5

6 release files

This release

0.3.4 This release

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