Left-rule blocks mark artificial prose; quotations retain their own attribution.
myArch gives structure an address: indexed headings for documents, and a separate four-level cell model for architectonic Python code. You can inspect a document's numbering, preview a repair, and apply it without making every heading look alike.
Documentation: arch.docs.doering.ai
Installation
Use Python 3.14+. These examples follow the 2.1 source tree; the published 1.0 package uses an older configuration schema. Install from Git for the behavior described here (release notes):
uv tool install 'git+https://gitlab.com/doering-ai/libs/arch.git'
# Or, in an activated Python 3.14+ virtual environment:
python -m pip install 'git+https://gitlab.com/doering-ai/libs/arch.git'
Try an address
$ arch --json idx parse '1.2'
{"version": 1, "rendered": "1.2", "ordinals": [0, 1], "depth": 2, "styles": ["number", "number"]}
The visible address is one-based; its internal ordinals are zero-based. Document indexes can be numeric, alphabetic, Roman, or symbolic, with dotted or compact rendering and optional markers and wrappers. Their depth is arbitrary: changing the presentation doesn't change the place.
Inspect, then apply
From this repository's checkout, these commands inspect one configured document:
arch check docs/idx.md
arch --json plan docs/idx.md
arch format --check docs/idx.md
arch format --diff docs/idx.md
checkreports index diagnostics;planexposes the proposed edits. The twoformatcommands check header presentation or print a patch without writing it. When you're ready,applywrites the index plan, while bareformatwrites the header-format plan:
arch apply docs/idx.md
arch format docs/idx.md
Each file is planned, checked against its source digest, and atomically replaced. Its newline convention and final-newline state survive the edit. This is a per-file write boundary.
Choose what participates
Seeing an index doesn't enroll a file. Index planning needs an
indexing.pathsrule or an explicit--specoverride. Within an enrolled file,observedinserts only at hierarchy depths already represented there;allis allowed only on an explicit path rule.Configuration precedence is command flags, an explicit
--config, the nearest.arch.yaml,~/.config/my/arch.yaml, then built-ins. Index enrollment and header formatting have independent selectors, with higher-precedence rules tried first. For example:
specs:
formal-markdown:
styles: [number]
separator: '.'
wrapper: '`'
indexing:
default: off
insertion: observed
paths:
- glob: 'policies/**'
spec: formal-markdown
insertion: all
header_mode: flex
header_defaults:
markdown: markdown
source: source
typst: off
rst: off
unknown: off
header_paths:
- path: 'README.md'
profile: off
ignore:
- 'vendor/**'
Header formatting defaults to
flex: existing indexed shapes establish file-local level precedents, preserving authored presentation. Useheader_mode: strictorarch format --mode strictwhen the configured profile should set case and geometry. The built-in Markdown profile keeps title case, leaves H1 unindexed, and renders recognized H2+ indexes as dotted backtick tags such as`1.2`. Typst, reStructuredText, and unknown suffixes remain off until they have structural adapters.Use
arch config show --path FILEto inspect the selected family, enrollment, spec/profile sources, insertion policy, and matching ignore rule.
Tag a multi-file work
An edition split into chapter files, with an
index.mdwhosetoctreelists them, is tagged as one outline byarch book. Every heading but a part heading gets a backtick tag such as`3.2.`, front matter takes`0.`, and titles are never edited. A part heading, the# [Commentary, part 2]that opens each later file of a section cut in parts, continues the H1 before it and takes no tag. A work is touched only when--specnames a backtick spec (the built-inlitis one) or anindexing.pathsrule enrolls itsindex.md:
arch book check --spec lit works/demo
arch book plan --spec lit works/demo
arch book apply --spec lit works/demo
arch book outline --spec lit works/demo
planandapplyprint the old-to-new renumber map for tags that shift when a heading is inserted or removed.arch.idx.read_outline()gives other tools each heading's idx, file, line, level, and title straight from the tags, with no sidecar file.
Two index domains
arch.idx.Idxis the non-empty, arbitrary-depth document address used above.arch.Quadis the original fixed, four-place architectonic address;arch.Idxremains its compatibility name. A Quad admits the empty root and abstracta/bhalves, with a special four-branch ancestry. These domains are separate, not subtypes of one another.The Python library adds
LangandCell, theArchitectonicregistry and defaultARCHinstance, and source-code models includingModule,File, andElement. Thethesis,antithesis, andsynthesisdecorators alias an element's three moments onto its class. The package guide points to these entry points.
Terminal workspace
With the optional
terminalextra installed, barearchopens the PyRatatui browser when stdin and stdout are terminals. For captured output or scripts, use a subcommand.arch spec --input headers.yaml --output headers.yamlopens the profile editor for an existing specification and can save changes to that file. See the header formatting guide for the editor andHeaderSpec.
Further reading
Metadata
Release files for my-arch 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| my_arch-2.1.0.tar.gz | 172.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| my_arch-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 371.8 kB
Release files / my_arch-2.1.0.tar.gz
| Download URL | my_arch-2.1.0.tar.gz |
|---|---|
| Size | 172.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
889cdb250a486961d4cdbec4c54e8ff9453a77274dabca71d881970638fe8167
|
|
BLAKE2b-256 checksum How to use checksums |
42ada74ff507c18282e9e2ea5a2eb2ec27c04620822a5d5c6fb76c0429263af9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / my_arch-2.1.0-py3-none-any.whl
| Download URL | my_arch-2.1.0-py3-none-any.whl |
|---|---|
| Size | 198.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0017ab9904289a7210dfb6853f9dc3e75264b96c16688ac1acc411f54849b8c8
|
|
BLAKE2b-256 checksum How to use checksums |
9d4f575beed2280f8aa6fdd4132d67582b90a4abdbb0332277a151e5a6eb2a70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|