Xtracto Web Development Framework
eXtensible, Configurable, and Reusable Automation Component Tool and Organizer for html through pypx
Xtracto is a lightweight web development framework designed to simplify the process of creating dynamic web pages using Python. It uses a custom markup language called pypx (Python Page eXtension) that compiles to HTML with Jinja2 templating support.
This module is a parser for pypx (custom markup language) to html
read pypx.md to understand the custom markup language
Features
- Parser Class: Easily parse and transform
pypxcontent using theParserclass. - Component System: Build reusable components and import them into your pages.
- Layout Support: Define layouts to wrap your pages with consistent headers, footers, etc.
- Jinja2 Integration: Use Jinja2 syntax for variables, loops, and logic.
- Tailwind CSS Support: Automatically generates Tailwind CSS based on your usage.
- Build System: Pre-render your pages to HTML for production.
It is recommended that you use python 3.9+ for best compatibility
Installation
pip install xtracto
Sample project
You can view a sample project at shashstormer/xtracto_website.
Usage
1. Parser Class
Initialize the Parser class with the content or file path:
Example with content
from xtracto import Parser
content = "html\n body\n h1\n Hello World"
parser = Parser(content=content)
parser.render()
print(parser.html_content)
Example with a file path
from xtracto import Parser
# Assuming you have configured xtracto.config.py
parser = Parser(path="index.pypx")
parser.render()
print(parser.html_content)
2. Building for Production
Use the Builder class to compile all your pages to HTML:
from xtracto import Builder
builder = Builder()
builder.build()
Configuration
The project root is determined by the presence of xtracto.config.py. It must be present in your project root directory.
Paths in the pypx files are relative to the project root.
Customize project-specific configurations in the xtracto.config.py file:
# xtracto.config.py
modules_dir = "xtractocomponents" # Directory for reusable components
pages_dir = "xtractopages" # Directory for your pages
build_dir = "build" # Directory for built HTML files
log_level = "info" # Logging level
reparse_tailwind = False # Whether to regenerate Tailwind CSS on render
production = False # Production mode flag
Metadata
Release files for xtracto 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xtracto-0.0.12.tar.gz | 752.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xtracto-0.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.5 MB
Release files / xtracto-0.0.12.tar.gz
| Download URL | xtracto-0.0.12.tar.gz |
|---|---|
| Size | 752.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57464a54c2f2b0e63d6351803530f23ee9e4bf99fe1bb13aa47627332b5db107
|
|
BLAKE2b-256 checksum How to use checksums |
9b4071bb63099827be3351c57922699375972504ca08ecf27ec0d3d66d694fd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 23, 2025.
Transparency logRelease files / xtracto-0.0.12-py3-none-any.whl
| Download URL | xtracto-0.0.12-py3-none-any.whl |
|---|---|
| Size | 783.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
261b1f96889f1f64a3354349285109de863eae1e142be1241d1e9713908273db
|
|
BLAKE2b-256 checksum How to use checksums |
78c408f91c20d36b06153627eb011b45d812ba90550386f503f065b59cb5a4ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 23, 2025.
Transparency log