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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atrep-0.3.0.tar.gz.
File metadata
- Download URL: atrep-0.3.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6acf8a750dcdc72611a5cdb73453250bfa5e8428fd6c584aa3739c948152bd0a
|
|
| MD5 |
45f707397ee5e4b6731193307e9da7d9
|
|
| BLAKE2b-256 |
eaf752a29e813d6747e4050acb07d9abf5da964406bf20d02c72e65495de4570
|
Provenance
The following attestation bundles were made for atrep-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on deyanovich/atrep-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atrep-0.3.0.tar.gz -
Subject digest:
6acf8a750dcdc72611a5cdb73453250bfa5e8428fd6c584aa3739c948152bd0a - Sigstore transparency entry: 2336956333
- Sigstore integration time:
-
Permalink:
deyanovich/atrep-py@f5397a18070fb1b8eab96181484e2852df23d745 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f5397a18070fb1b8eab96181484e2852df23d745 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atrep-0.3.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: atrep-0.3.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 643.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6255df0ae011e4e2caa4408d8affd6a7941f777d5ec402a260066b7c99fde2fb
|
|
| MD5 |
83b01d061c90a48dc79c6fabcdfda743
|
|
| BLAKE2b-256 |
3ed474ae39fcce0be8cbc67cfad4f14f0a0ec804e964aac546894b724721194d
|
Provenance
The following attestation bundles were made for atrep-0.3.0-cp39-abi3-win_amd64.whl:
Publisher:
publish-pypi.yml on deyanovich/atrep-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atrep-0.3.0-cp39-abi3-win_amd64.whl -
Subject digest:
6255df0ae011e4e2caa4408d8affd6a7941f777d5ec402a260066b7c99fde2fb - Sigstore transparency entry: 2336956410
- Sigstore integration time:
-
Permalink:
deyanovich/atrep-py@f5397a18070fb1b8eab96181484e2852df23d745 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f5397a18070fb1b8eab96181484e2852df23d745 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atrep-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: atrep-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 720.3 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b0abe850eb64df68edc5100f9bd8f3c4f31a4c40a30b43de07a42244e483dd6
|
|
| MD5 |
fbaef094d23175c7afa6f6dcba6aa333
|
|
| BLAKE2b-256 |
169ad9a77eea5ddf4e387cd3baa616648db10d60ff536a32a5ffa15cdead6dc0
|
Provenance
The following attestation bundles were made for atrep-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish-pypi.yml on deyanovich/atrep-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atrep-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
8b0abe850eb64df68edc5100f9bd8f3c4f31a4c40a30b43de07a42244e483dd6 - Sigstore transparency entry: 2336956467
- Sigstore integration time:
-
Permalink:
deyanovich/atrep-py@f5397a18070fb1b8eab96181484e2852df23d745 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f5397a18070fb1b8eab96181484e2852df23d745 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atrep-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: atrep-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 665.4 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03f80e6ce259c193fa91ca901f3a177c1f2cede9a417857b05ecb704b69b784e
|
|
| MD5 |
55289b07aa9d003be25b78fa3dbdabf1
|
|
| BLAKE2b-256 |
ad6b0190949852dde7208ea230485007a11312a4352beef2fc1cda65bf60e56d
|
Provenance
The following attestation bundles were made for atrep-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish-pypi.yml on deyanovich/atrep-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atrep-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
03f80e6ce259c193fa91ca901f3a177c1f2cede9a417857b05ecb704b69b784e - Sigstore transparency entry: 2336956577
- Sigstore integration time:
-
Permalink:
deyanovich/atrep-py@f5397a18070fb1b8eab96181484e2852df23d745 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f5397a18070fb1b8eab96181484e2852df23d745 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atrep-0.3.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: atrep-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 643.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d51041777fcd30724d4bdca611403f378e96a0ce22b945f493c20532f0469ba
|
|
| MD5 |
6defddc9c0593ed01e19a7eb2f117067
|
|
| BLAKE2b-256 |
d8f8aaebd1e5968afd0d597cd4d4f03eba10c6be6246831bc0c713b9295ecb35
|
Provenance
The following attestation bundles were made for atrep-0.3.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-pypi.yml on deyanovich/atrep-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atrep-0.3.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
1d51041777fcd30724d4bdca611403f378e96a0ce22b945f493c20532f0469ba - Sigstore transparency entry: 2336956525
- Sigstore integration time:
-
Permalink:
deyanovich/atrep-py@f5397a18070fb1b8eab96181484e2852df23d745 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f5397a18070fb1b8eab96181484e2852df23d745 -
Trigger Event:
push
-
Statement type:
File details
Details for the file atrep-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: atrep-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 666.1 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f1babd5b9d3b0bd921c2816d7976cefc77340b1bd3353018df7ee3f448b3c3b
|
|
| MD5 |
40be4bfa5d773be761c984efc7b117d8
|
|
| BLAKE2b-256 |
f6454d831ede249bce597f7b48f4da4053f8ed2cd9d6896ddc3f01c219c8b376
|
Provenance
The following attestation bundles were made for atrep-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish-pypi.yml on deyanovich/atrep-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atrep-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
8f1babd5b9d3b0bd921c2816d7976cefc77340b1bd3353018df7ee3f448b3c3b - Sigstore transparency entry: 2336956372
- Sigstore integration time:
-
Permalink:
deyanovich/atrep-py@f5397a18070fb1b8eab96181484e2852df23d745 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f5397a18070fb1b8eab96181484e2852df23d745 -
Trigger Event:
push
-
Statement type: