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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atrep-0.3.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

atrep-0.3.1-cp39-abi3-win_amd64.whl (655.3 kB view details)

Uploaded CPython 3.9+Windows x86-64

atrep-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (732.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

atrep-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (676.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

atrep-0.3.1-cp39-abi3-macosx_11_0_arm64.whl (651.8 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

atrep-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl (674.1 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file atrep-0.3.1.tar.gz.

File metadata

  • Download URL: atrep-0.3.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for atrep-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f6ab78ef23c81468a5c65e294731fd609ce4801a99732d4b1ad31cec3a2ae0f6
MD5 8ccd1b5b7f40586a24558e2d975b88dd
BLAKE2b-256 18e93fa36c1d723fc82731d0311e4c7ea084e6b1546565b2fd37ea31ad6d737e

See more details on using hashes here.

Provenance

The following attestation bundles were made for atrep-0.3.1.tar.gz:

Publisher: publish-pypi.yml on deyanovich/atrep-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atrep-0.3.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: atrep-0.3.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 655.3 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for atrep-0.3.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 adb200eb45eced55a5fa47f96492c872b49dc9c7e56f98ddd941bd5363a475f3
MD5 a9af2cb9d8f0841d632b795641f06527
BLAKE2b-256 ae9f8093d72f42c62f9e1b47f5e14c29e828f33a46751486ee0d725a8c9c2f52

See more details on using hashes here.

Provenance

The following attestation bundles were made for atrep-0.3.1-cp39-abi3-win_amd64.whl:

Publisher: publish-pypi.yml on deyanovich/atrep-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atrep-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for atrep-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31dc28d6723ca6c4480918773d741c263c5b438abd1ee3889afb47f41e2eeead
MD5 ca69346075aafb3660c50baa91d4c2d9
BLAKE2b-256 f80e9fa680006a8ff564eb370ef8e567cced49207c4a4751b2300122e339ba01

See more details on using hashes here.

Provenance

The following attestation bundles were made for atrep-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on deyanovich/atrep-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atrep-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for atrep-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 11f92b766d0d37efd05759cde00f53d989cb5f6e0a3cae77c7d5e6ca830b8938
MD5 bd56ada47f8c0e85948ee92a31696833
BLAKE2b-256 cb6f4cf9e0427a5c6982baeb70930e35c7956125093b2d9010b8d163a555e793

See more details on using hashes here.

Provenance

The following attestation bundles were made for atrep-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-pypi.yml on deyanovich/atrep-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atrep-0.3.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: atrep-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 651.8 kB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for atrep-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06973e24b3b27e72e46018eecc7521147daaaba4554bece77b2dc5a6f7564a82
MD5 8b2cc0e5124059cee1b125af71e06927
BLAKE2b-256 77dbf99858878682d045b1a520831add48b8d984707a8cfc4f8d7165c9bf2074

See more details on using hashes here.

Provenance

The following attestation bundles were made for atrep-0.3.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on deyanovich/atrep-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atrep-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for atrep-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 37339cf8a6f8b6bf3d76f50e222b506e906c887a3d4aaec9f4c0879efaa2c87e
MD5 1db049d084e78f8dd9792c5a7e5c40fd
BLAKE2b-256 428c92a073465f72e4d400937d61b344f850a1d0e2bfa62400881ad03e3e6f6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for atrep-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-pypi.yml on deyanovich/atrep-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.1 This release

6 files

0.3.0

6 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