📝 PyAct Builder
PyAct Builder is a lightweight yet powerful Markdown template engine that allows you to dynamically generate documents using Python scripts.
Thanks to recursive processing, you can build complex documents from small, independent blocks ("nodes"), inject data (dates, API results, calculations), and automate the creation of reports or static pages.
🚀 Key Features
- Python Integration: Each text fragment can have a corresponding
.pyscript that supplies data. - Recursion: Nest templates within templates without limits (e.g.,
Main -> Section -> Component). - Simple Syntax: Use
{[component]}to insert blocks and{{variable}}to insert data. - CLI Tool: A built-in command-line tool for quick setup and building.
📦 Installation
Install the package directly from PyPI:
pip install pyact
⚡ Quick Start
-
Initialize a new project: The tool automatically generates the directory structure and example files.
pyact make -
Build the document: Processes
main.mdand saves the result in theoutput/folder.pyact run
📂 Project Structure
After running the make command, your project will look like this:
.
├── main.md # Main input file
├── output/ # Destination for the final file (output.md)
└── nodes/ # Folder containing your components
├── header.md # Component template
└── header.py # Component logic (optional)
📖 How It Works
The system relies on two types of tags:
1. Component Tags: {[name]}
These insert content from the nodes/name.md file. If a corresponding nodes/name.py file exists, it will be executed first to provide data to the template.
Example in main.md:
# Daily Report
Below are the sales figures.
{[sales_table]}
2. Variable Tags: {{key}}
Inside .md files located in the nodes/ folder, you can use variables that will be replaced by the Python script.
Example in nodes/sales_table.py:
def sales_table():
# Return a dictionary (dict) with data
return {
"date": "2023-10-27",
"total": 1500
}
Example in nodes/sales_table.md:
### Sales for {{date}}
Total revenue was: **{{total}} USD**.
Final Result (output.md):
# Daily Report
Below are the sales figures.
### Sales for 2023-10-27
Total revenue was: **1500 USD**.
🛠️ Advanced
Returning JSON
If your Python script is complex, instead of a dictionary (dict), it can return a JSON formatted string. The engine will parse it automatically.
Error Handling
If you forget to create an .md file or if a .py script returns an error, the builder will notify you in the console. In the final output file, it will simply skip the faulty fragment instead of breaking the entire document.
Metadata
Release files for pyact-engine 0.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 | Provenance | Actions |
|---|---|---|---|---|
| pyact_engine-0.1.0.tar.gz | 5.2 kB | Without provenance | Details for pyact_engine-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyact_engine-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyact_engine-0.1.0-py3-none-any.whl |
Total release size: 10.7 kB
Release files / pyact_engine-0.1.0.tar.gz
| Download URL | pyact_engine-0.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e558c1aa89a139ea58efa5de7e021eec906ab1495d95008a3f18d66a29e68063
|
|
BLAKE2b-256 checksum How to use checksums |
ae8e9d5044d79719ee2c94a71b6c6a16950f9db275b5b341f1818c60747120a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / pyact_engine-0.1.0-py3-none-any.whl
| Download URL | pyact_engine-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9dccf785ce9ed58e82515eaf9fba030caee2b246be7bea8291c127b23b0b89d0
|
|
BLAKE2b-256 checksum How to use checksums |
bf2591839c5900ce72f640762b0d5f1110f58aa3208f527d4fcfa8816f77fef8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for pyact-engine 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.