A PDF book generator for structured ritual and ceremonial texts
Project description
bookcraft
A Python library for generating PDF books from structured text content.
Installation
pip install bookcraft
Usage
from bookcraft import generate
generate(
books_path="./books/",
settings_path="./c-settings.yaml",
fonts_path="./fonts.yaml",
keywords_path="./c-keywords.yaml",
output_path="./output/craft.pdf",
mode="craft",
)
Modes
| Mode | Description |
|---|---|
craft |
Craft, light theme |
craft-dark |
Craft, dark theme |
ra |
Royal Arch, light theme |
ra-dark |
Royal Arch, dark theme |
Page format
Pages are plain .txt files named page-1.txt, page-2.txt, etc. inside each book directory.
Headings
A line starting with # is rendered as a heading.
#Opening the Lodge in the First Degree
Roles
A line starting with $ highlights the speaker's role name.
$W. M. Brethren, assist me to open the Lodge.
Line breaks
= at the end of a line inserts a line break. Multiple = insert multiple breaks.
$W. M. What is the first care of every Freemason?=
$J. W. To see that the Lodge is properly tyled.=
Italic text
Text wrapped in > and < is rendered in italic.
$I. G. (to J. W., by name) >I. G. gives k....s and is answered by Tyler.<
Keywords
Words and abbreviations listed in keywords.yaml are automatically rendered in bold wherever they appear in the text.
$W. M. The candidate is an E. A.
Development setup
After cloning, install the pre-commit hooks (one-time):
uv run pre-commit install
This runs type checking and tests automatically before every commit.
Releasing a new version
- Bump the version in
pyproject.toml - Add an entry to
CHANGELOG.md - Commit and tag:
git add pyproject.toml CHANGELOG.md
git commit -m "Release v0.2.0"
git tag v0.2.0
git push && git push --tags
GitHub Actions will build and publish to PyPI automatically.
Content layout
Your content project should provide:
your-project/
├── books/ # directories of page-N.txt files
├── fonts/ # font files referenced in fonts.yaml
├── config/
│ ├── fonts.yaml
│ ├── c-settings.yaml
│ ├── c-keywords.yaml
│ ├── ra-settings.yaml
│ └── ra-keywords.yaml
└── output/ # generated PDFs written here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 bookcraft-1.1.0.tar.gz.
File metadata
- Download URL: bookcraft-1.1.0.tar.gz
- Upload date:
- Size: 50.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9038c3b02900855fee8331ff2d6ca60247727aaf189252b11ece23ef3fa6a837
|
|
| MD5 |
fbba1e1bba280012ed97c3aad4700040
|
|
| BLAKE2b-256 |
2a9c4f1fa02ff80376a4fcc20c9f17ba9920c2a388ed4f60438a5725c87d3e99
|
Provenance
The following attestation bundles were made for bookcraft-1.1.0.tar.gz:
Publisher:
publish.yml on albertkol/bookcraft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bookcraft-1.1.0.tar.gz -
Subject digest:
9038c3b02900855fee8331ff2d6ca60247727aaf189252b11ece23ef3fa6a837 - Sigstore transparency entry: 1630356868
- Sigstore integration time:
-
Permalink:
albertkol/bookcraft@0ee4b34918635408618a223942e7af958bab6364 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/albertkol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ee4b34918635408618a223942e7af958bab6364 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bookcraft-1.1.0-py3-none-any.whl.
File metadata
- Download URL: bookcraft-1.1.0-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d01d396d1700449414491698c05652ef72cf10410c1b80b9d9e3bf205a227ad
|
|
| MD5 |
85f9eaf79a054f196c16d43dc47875a6
|
|
| BLAKE2b-256 |
0086f816b28513432989a3516e2ae76a9d16ceafe15e04c8d124cdd51701a681
|
Provenance
The following attestation bundles were made for bookcraft-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on albertkol/bookcraft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bookcraft-1.1.0-py3-none-any.whl -
Subject digest:
4d01d396d1700449414491698c05652ef72cf10410c1b80b9d9e3bf205a227ad - Sigstore transparency entry: 1630356876
- Sigstore integration time:
-
Permalink:
albertkol/bookcraft@0ee4b34918635408618a223942e7af958bab6364 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/albertkol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ee4b34918635408618a223942e7af958bab6364 -
Trigger Event:
push
-
Statement type: