Xtracto is a lightweight web development framework designed to simplify the process of creating dynamic web pages using Python and pypx.
Project description
Note:
As i was thinking of possibilities there is a huge security flaw in this logic if you render user input on server side as it allows possiblility for variable name injection, if anyone wants to fix feel free to do so as i wont be doing it anytime soon, everything is fine as long as you dont render unsanitized user input on server side
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.
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 content using the
Parserclass. - Automatic Server Setup: Use the
Appclass for hassle-free server setup with FastAPI and Uvicorn. - Testing Support: Conduct tests on your content or files using the
Testsclass.
It is recommended that you use python 3.9 (as of 3rd january 2024) for best compatibility
Installation
pip install xtracto
Sample project
you can view a sample project at shashstormer/xtracto_website And its deployed version at xtracto.shashstom.in
Usage
1. Parser Class
Initialize the Parser class with the content or file path:
Example with content
from xtracto import Parser
content = "Your content here"
parser = Parser(content=content)
Example with a file path
from xtracto import Parser
file_path = "path/to/your/file.pypx"
parser = Parser(path=file_path)
2. Automatic Server Setup
Use the App class for automatic server setup:
from xtracto import App
app = App()
3. Compilation
Compile non-dynamic pages to HTML:
Example
from xtracto import Parser
parser = Parser()
parser.compile(start_path_for_map="/")
Configuration
project root is determined using the presence of xtracto.config.py it must be present otherwise will raise error.
Paths in the pypx files are relative to the project root.
Paths in the config file are relative to the project root.
The config file can be empty.
Customize project-specific configurations in the xtracto.config.py file. Update the following parameters:
modules_dir: Directory for modules (default: "xtractocomponents").pages_dir: Directory for pages (default: "xtractopages").strip_imports: Whether to strip imports (default: True).raise_value_errors_while_importing: Whether to raise value errors during imports (default: True).
Project details
Release history Release notifications | RSS feed
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 xtracto-0.0.8.tar.gz.
File metadata
- Download URL: xtracto-0.0.8.tar.gz
- Upload date:
- Size: 728.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c10d52498a776f772c522260e368207e0447655f401091ac47fbf1a7f17e7af8
|
|
| MD5 |
68fc06de3d39e903a6d963b006ed91b5
|
|
| BLAKE2b-256 |
8c6e353e1b49dedc40aa074cb0766477bc5f69edb42928e0f270317eaae63660
|
Provenance
The following attestation bundles were made for xtracto-0.0.8.tar.gz:
Publisher:
publish-on-push.yml on shashstormer/xtracto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xtracto-0.0.8.tar.gz -
Subject digest:
c10d52498a776f772c522260e368207e0447655f401091ac47fbf1a7f17e7af8 - Sigstore transparency entry: 772281476
- Sigstore integration time:
-
Permalink:
shashstormer/xtracto@59e42c5df37a51b37b872f301d3d644b425708cd -
Branch / Tag:
refs/heads/master - Owner: https://github.com/shashstormer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-on-push.yml@59e42c5df37a51b37b872f301d3d644b425708cd -
Trigger Event:
push
-
Statement type:
File details
Details for the file xtracto-0.0.8-py3-none-any.whl.
File metadata
- Download URL: xtracto-0.0.8-py3-none-any.whl
- Upload date:
- Size: 752.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e24d90db60ad94a2d778956b537300f3377d408916a95c3b5b0d7c569cd33b14
|
|
| MD5 |
7534159236b699935f0774704cea4295
|
|
| BLAKE2b-256 |
6111edab3c58de688fa8ba0b4bd525e79082a3bfad035766bf213613ddbcf9a4
|
Provenance
The following attestation bundles were made for xtracto-0.0.8-py3-none-any.whl:
Publisher:
publish-on-push.yml on shashstormer/xtracto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xtracto-0.0.8-py3-none-any.whl -
Subject digest:
e24d90db60ad94a2d778956b537300f3377d408916a95c3b5b0d7c569cd33b14 - Sigstore transparency entry: 772281482
- Sigstore integration time:
-
Permalink:
shashstormer/xtracto@59e42c5df37a51b37b872f301d3d644b425708cd -
Branch / Tag:
refs/heads/master - Owner: https://github.com/shashstormer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-on-push.yml@59e42c5df37a51b37b872f301d3d644b425708cd -
Trigger Event:
push
-
Statement type: