xtracto


Namextracto JSON
Version 0.0.7 PyPI version JSON
download
home_pageNone
SummaryXtracto is a lightweight web development framework designed to simplify the process of creating dynamic web pages using Python and pypx.
upload_time2024-06-09 21:36:11
maintainerNone
docs_urlNone
authorshashstormer
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Xtracto Web Development Framework
eXtensible, Configurable, and Reusable Automation Component Tool and Organizer <sub>for html through pypx</sub>


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](https://github.com/shashstormer/xtracto/blob/master/xtracto/pypx.md) to understand the custom markup language**

## Features

- **Parser Class:** Easily parse and transform content using the `Parser` class.
- **Automatic Server Setup:** Use the `App` class for hassle-free server setup with FastAPI and Uvicorn.
- **Testing Support:** Conduct tests on your content or files using the `Tests` class.

> **It is recommended that you use python 3.9 (as of 3rd january 2024) for best compatibility**

## Installation

```cmd
pip install xtracto
```


## Sample project

you can view a sample project at [shashstormer/xtracto_website](https://github.com/shashstormer/xtracto_website)
And its deployed version at [xtracto.shashstom.in](https://xtracto.shashstorm.in/)

### Usage

#### 1. Parser Class

Initialize the `Parser` class with the content or file path:


#### Example with content
```python
from xtracto import Parser
content = "Your content here"
parser = Parser(content=content)
```


#### Example with a file path
```python
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:

```python
from xtracto import App
app = App()
```

#### 3. Compilation

Compile non-dynamic pages to HTML:


#### Example
```python
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).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xtracto",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "shashstormer",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/1b/5b/c724f0487a764bd9e20cb0764e3789cc5be77bbe87dd93d9e2b08fc461b0/xtracto-0.0.7.tar.gz",
    "platform": null,
    "description": "\r\n# Xtracto Web Development Framework\r\neXtensible, Configurable, and Reusable Automation Component Tool and Organizer <sub>for html through pypx</sub>\r\n\r\n\r\nXtracto is a lightweight web development framework designed to simplify the process of creating dynamic web pages using Python.\r\n\r\n> **This module is a parser for pypx (custom markup language) to html**\r\n> ****\r\n> **read [pypx.md](https://github.com/shashstormer/xtracto/blob/master/xtracto/pypx.md) to understand the custom markup language**\r\n\r\n## Features\r\n\r\n- **Parser Class:** Easily parse and transform content using the `Parser` class.\r\n- **Automatic Server Setup:** Use the `App` class for hassle-free server setup with FastAPI and Uvicorn.\r\n- **Testing Support:** Conduct tests on your content or files using the `Tests` class.\r\n\r\n> **It is recommended that you use python 3.9 (as of 3rd january 2024) for best compatibility**\r\n\r\n## Installation\r\n\r\n```cmd\r\npip install xtracto\r\n```\r\n\r\n\r\n## Sample project\r\n\r\nyou can view a sample project at [shashstormer/xtracto_website](https://github.com/shashstormer/xtracto_website)\r\nAnd its deployed version at [xtracto.shashstom.in](https://xtracto.shashstorm.in/)\r\n\r\n### Usage\r\n\r\n#### 1. Parser Class\r\n\r\nInitialize the `Parser` class with the content or file path:\r\n\r\n\r\n#### Example with content\r\n```python\r\nfrom xtracto import Parser\r\ncontent = \"Your content here\"\r\nparser = Parser(content=content)\r\n```\r\n\r\n\r\n#### Example with a file path\r\n```python\r\nfrom xtracto import Parser\r\nfile_path = \"path/to/your/file.pypx\"\r\nparser = Parser(path=file_path)\r\n```\r\n\r\n#### 2. Automatic Server Setup\r\n\r\nUse the `App` class for automatic server setup:\r\n\r\n```python\r\nfrom xtracto import App\r\napp = App()\r\n```\r\n\r\n#### 3. Compilation\r\n\r\nCompile non-dynamic pages to HTML:\r\n\r\n\r\n#### Example\r\n```python\r\nfrom xtracto import Parser\r\nparser = Parser()\r\nparser.compile(start_path_for_map=\"/\")\r\n```\r\n\r\n\r\n## Configuration\r\n\r\n\r\nproject root is determined using the presence of `xtracto.config.py` it must be present otherwise will raise error.\r\n\r\nPaths in the pypx files are relative to the project root.\r\n\r\nPaths in the config file are relative to the project root.\r\n\r\nThe config file can be empty.\r\n\r\nCustomize project-specific configurations in the `xtracto.config.py` file. Update the following parameters:\r\n\r\n- `modules_dir`: Directory for modules (default: \"xtractocomponents\").\r\n- `pages_dir`: Directory for pages (default: \"xtractopages\").\r\n- `strip_imports`: Whether to strip imports (default: True).\r\n- `raise_value_errors_while_importing`: Whether to raise value errors during imports (default: True).\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Xtracto is a lightweight web development framework designed to simplify the process of creating dynamic web pages using Python and pypx.",
    "version": "0.0.7",
    "project_urls": {
        "GitHub": "https://github.com/shashstormer/xtracto"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1affc2c279af3cc2af0795038feaab92b2a0a737abf2034bdbeb1ae8324fb51a",
                "md5": "f6361283ae727aa16b305aba13674995",
                "sha256": "9dd8fb0b6b3f4a3250111d0476e4ec682dd1dc4b516b722d244bc07cd90c3816"
            },
            "downloads": -1,
            "filename": "xtracto-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f6361283ae727aa16b305aba13674995",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 757193,
            "upload_time": "2024-06-09T21:36:07",
            "upload_time_iso_8601": "2024-06-09T21:36:07.973817Z",
            "url": "https://files.pythonhosted.org/packages/1a/ff/c2c279af3cc2af0795038feaab92b2a0a737abf2034bdbeb1ae8324fb51a/xtracto-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b5bc724f0487a764bd9e20cb0764e3789cc5be77bbe87dd93d9e2b08fc461b0",
                "md5": "1e730e97cbcfc505f03972ad9347fcc0",
                "sha256": "ad646ef34fdb6540c847b28356d22e4c89ac057d1fa4ff64e1401700443eef6e"
            },
            "downloads": -1,
            "filename": "xtracto-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "1e730e97cbcfc505f03972ad9347fcc0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 730415,
            "upload_time": "2024-06-09T21:36:11",
            "upload_time_iso_8601": "2024-06-09T21:36:11.275733Z",
            "url": "https://files.pythonhosted.org/packages/1b/5b/c724f0487a764bd9e20cb0764e3789cc5be77bbe87dd93d9e2b08fc461b0/xtracto-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-09 21:36:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shashstormer",
    "github_project": "xtracto",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "xtracto"
}
        
Elapsed time: 0.25722s