nutritious


Namenutritious JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/itsmeadarsh2008/nutritious
SummaryA jsx-preprocessor for Python which enables the coder to write JSX directly in Python 🗿
upload_time2024-05-27 17:54:54
maintainerNone
docs_urlNone
authorAdarsh Gourab Mahalik
requires_python<4.0,>=3.9
licenseGPL
keywords jsx nutritious preprocessor python jsx-python jsx-py jsx-preprocessor jsx-transpiler jsx-compiler jsx-parser jsx-renderer jsx-generator jsx-transformer jsx-converter jsx-translation jsx-translation-tool jsx-to-python jsx-in-python jsx-for-python jsx-python-integration jsx-python-support python-jsx py-jsx python-jsx-preprocessor python-jsx-transpiler python-jsx-compiler python-jsx-parser python-jsx-renderer python-jsx-generator python-jsx-transformer python-jsx-converter python-jsx-translation python-jsx-translation-tool jsx-python-converter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<img src="https://gist.githubusercontent.com/itsmeadarsh2008/2b89b1794fd67e844441273fa5dcf77b/raw/cb35ed3e3d4b3cdcf2604364152b59fb4bc0c17c/nutritious.svg" height="300">
</div>

<h1 align="center">Nutritious Litchi<br>
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dd/nutritious">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/itsmeadarsh2008/nutritious">
<img alt="GitHub Issues or Pull Requests" src="https://img.shields.io/github/issues/itsmeadarsh2008/nutritious">
<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/nutritious">
<img src="https://user-images.githubusercontent.com/74038190/225813708-98b745f2-7d22-48cf-9150-083f1b00d6c9.gif">
</h1>

**Nutritious Litchi** is a Python package that allows you to write JSX-like syntax in Python for creating HTML elements and components. It contains a CLI which is used to convert XML-JSX to Python Objects. **Feel free to use to make a web framework with this**. This started as a fork of [Packed](https://github.com/michaeljones/packed).

> [!WARNING]  
> Please note that this is project is in experimental stage. It is a fork of [Packed](https://github.com/michaeljones/packed) and has been modified and optimized.

## Installation
```
# you can use any python package manager like pip and poetry to install nutritious instead
pip install nutritious
```

## Usage

### Basic Example (located in `app/` folder)

```python
from nutritious import litchi, Element
# Element import is required even though it's not in the script.

@litchi
def render():
    return (
        <div>
            <h1>Hello, World!</h1>
            <p>This is a JSX-like syntax in Python.</p>
            <a href="https://example.com">Link</a>
        </div>
    )
```

### Custom Components

```python
from nutritious import Component, litchi

class MyComponent(Component): # type: ignore
    def render(self):
        return <div>This is a custom component with a prop: {self.props['message']}</div>

@litchi
def app():
    return <MyComponent message="Hello from a component"/>
```

# Output `dist/` folder
```python
from nutritious import litchi, Element
# Element import required even though it's not in the script.

@litchi
def render():
    return (
        Element(
            'div',
            {},
            ' ',
            Element(
                'h1',
                {},
                'Hello, World!',
            ),
            ' ',
            Element(
                'p',
                {},
                'This is a JSX-like syntax in Python.',
            ),
            ' ',
            Element(
                'a',
                {
                    'href': 'https://example.com',
                },
                'Link',
            ),
            ' ',
        )
    )

### Custom Components

from nutritious import Component, litchi

class MyComponent(Component): # type: ignore
    def render(self):
        return Element(
            'div',
            {},
            'This is a custom component with a prop: ',
            self.props['message'],
        )

@litchi
def app():
    return <MyComponent message="Hello from a component"/>
```

# How to convert to python objects? (HELP)
```
python -m nutritious -h
```

<div align="center">
<img src="https://user-images.githubusercontent.com/74038190/212257472-08e52665-c503-4bd9-aa20-f5a4dae769b5.gif">
</div>

**Author**: A Python3-Compatible Fork of An Archived Project Called [Packed](https://github.com/michaeljones/packed) <br>
**Modified and Optimized** by [Adarsh Gourab Mahalik](https://github.com/itsmeadarsh2008)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/itsmeadarsh2008/nutritious",
    "name": "nutritious",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "jsx, nutritious, preprocessor, python, jsx-python, jsx-py, jsx-preprocessor, jsx-transpiler, jsx-compiler, jsx-parser, jsx-renderer, jsx-generator, jsx-transformer, jsx-converter, jsx-translation, jsx-translation-tool, jsx-to-python, jsx-in-python, jsx-for-python, jsx-python-integration, jsx-python-support, python-jsx, py-jsx, python-jsx-preprocessor, python-jsx-transpiler, python-jsx-compiler, python-jsx-parser, python-jsx-renderer, python-jsx-generator, python-jsx-transformer, python-jsx-converter, python-jsx-translation, python-jsx-translation-tool, jsx-python-converter",
    "author": "Adarsh Gourab Mahalik",
    "author_email": "gourabmahalikadarsh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e0/a3/0756e54d5a3dfdd7bcc69106fb934812dd1e132314340fe92e5989172476/nutritious-0.1.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n<img src=\"https://gist.githubusercontent.com/itsmeadarsh2008/2b89b1794fd67e844441273fa5dcf77b/raw/cb35ed3e3d4b3cdcf2604364152b59fb4bc0c17c/nutritious.svg\" height=\"300\">\n</div>\n\n<h1 align=\"center\">Nutritious Litchi<br>\n<img alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dd/nutritious\">\n<img alt=\"GitHub repo size\" src=\"https://img.shields.io/github/repo-size/itsmeadarsh2008/nutritious\">\n<img alt=\"GitHub Issues or Pull Requests\" src=\"https://img.shields.io/github/issues/itsmeadarsh2008/nutritious\">\n<img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/nutritious\">\n<img src=\"https://user-images.githubusercontent.com/74038190/225813708-98b745f2-7d22-48cf-9150-083f1b00d6c9.gif\">\n</h1>\n\n**Nutritious Litchi** is a Python package that allows you to write JSX-like syntax in Python for creating HTML elements and components. It contains a CLI which is used to convert XML-JSX to Python Objects. **Feel free to use to make a web framework with this**. This started as a fork of [Packed](https://github.com/michaeljones/packed).\n\n> [!WARNING]  \n> Please note that this is project is in experimental stage. It is a fork of [Packed](https://github.com/michaeljones/packed) and has been modified and optimized.\n\n## Installation\n```\n# you can use any python package manager like pip and poetry to install nutritious instead\npip install nutritious\n```\n\n## Usage\n\n### Basic Example (located in `app/` folder)\n\n```python\nfrom nutritious import litchi, Element\n# Element import is required even though it's not in the script.\n\n@litchi\ndef render():\n    return (\n        <div>\n            <h1>Hello, World!</h1>\n            <p>This is a JSX-like syntax in Python.</p>\n            <a href=\"https://example.com\">Link</a>\n        </div>\n    )\n```\n\n### Custom Components\n\n```python\nfrom nutritious import Component, litchi\n\nclass MyComponent(Component): # type: ignore\n    def render(self):\n        return <div>This is a custom component with a prop: {self.props['message']}</div>\n\n@litchi\ndef app():\n    return <MyComponent message=\"Hello from a component\"/>\n```\n\n# Output `dist/` folder\n```python\nfrom nutritious import litchi, Element\n# Element import required even though it's not in the script.\n\n@litchi\ndef render():\n    return (\n        Element(\n            'div',\n            {},\n            ' ',\n            Element(\n                'h1',\n                {},\n                'Hello, World!',\n            ),\n            ' ',\n            Element(\n                'p',\n                {},\n                'This is a JSX-like syntax in Python.',\n            ),\n            ' ',\n            Element(\n                'a',\n                {\n                    'href': 'https://example.com',\n                },\n                'Link',\n            ),\n            ' ',\n        )\n    )\n\n### Custom Components\n\nfrom nutritious import Component, litchi\n\nclass MyComponent(Component): # type: ignore\n    def render(self):\n        return Element(\n            'div',\n            {},\n            'This is a custom component with a prop: ',\n            self.props['message'],\n        )\n\n@litchi\ndef app():\n    return <MyComponent message=\"Hello from a component\"/>\n```\n\n# How to convert to python objects? (HELP)\n```\npython -m nutritious -h\n```\n\n<div align=\"center\">\n<img src=\"https://user-images.githubusercontent.com/74038190/212257472-08e52665-c503-4bd9-aa20-f5a4dae769b5.gif\">\n</div>\n\n**Author**: A Python3-Compatible Fork of An Archived Project Called [Packed](https://github.com/michaeljones/packed) <br>\n**Modified and Optimized** by [Adarsh Gourab Mahalik](https://github.com/itsmeadarsh2008)",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "A jsx-preprocessor for Python which enables the coder to write JSX directly in Python \ud83d\uddff",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/itsmeadarsh2008/nutritious/issues",
        "Homepage": "https://github.com/itsmeadarsh2008/nutritious",
        "Repository": "https://github.com/itsmeadarsh2008/nutritious.git"
    },
    "split_keywords": [
        "jsx",
        " nutritious",
        " preprocessor",
        " python",
        " jsx-python",
        " jsx-py",
        " jsx-preprocessor",
        " jsx-transpiler",
        " jsx-compiler",
        " jsx-parser",
        " jsx-renderer",
        " jsx-generator",
        " jsx-transformer",
        " jsx-converter",
        " jsx-translation",
        " jsx-translation-tool",
        " jsx-to-python",
        " jsx-in-python",
        " jsx-for-python",
        " jsx-python-integration",
        " jsx-python-support",
        " python-jsx",
        " py-jsx",
        " python-jsx-preprocessor",
        " python-jsx-transpiler",
        " python-jsx-compiler",
        " python-jsx-parser",
        " python-jsx-renderer",
        " python-jsx-generator",
        " python-jsx-transformer",
        " python-jsx-converter",
        " python-jsx-translation",
        " python-jsx-translation-tool",
        " jsx-python-converter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "358c5c7045d1d4ec53f3276a461b85cd18a0b55959448947fbd060daa2438007",
                "md5": "b79746a12e5c8226ee807495b008151e",
                "sha256": "018868d27f2a181869ef8ee8dbaeec99c3277e9c743146fe406e2f5fb53f7649"
            },
            "downloads": -1,
            "filename": "nutritious-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b79746a12e5c8226ee807495b008151e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 7677,
            "upload_time": "2024-05-27T17:54:53",
            "upload_time_iso_8601": "2024-05-27T17:54:53.195105Z",
            "url": "https://files.pythonhosted.org/packages/35/8c/5c7045d1d4ec53f3276a461b85cd18a0b55959448947fbd060daa2438007/nutritious-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0a30756e54d5a3dfdd7bcc69106fb934812dd1e132314340fe92e5989172476",
                "md5": "94ca00116317cb245eaa91bec680f1d2",
                "sha256": "99b838efb2d57152cb816e8ea19db87c5849789df45d0d7d5b8f4e4ded8c0873"
            },
            "downloads": -1,
            "filename": "nutritious-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "94ca00116317cb245eaa91bec680f1d2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 7337,
            "upload_time": "2024-05-27T17:54:54",
            "upload_time_iso_8601": "2024-05-27T17:54:54.693673Z",
            "url": "https://files.pythonhosted.org/packages/e0/a3/0756e54d5a3dfdd7bcc69106fb934812dd1e132314340fe92e5989172476/nutritious-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-27 17:54:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "itsmeadarsh2008",
    "github_project": "nutritious",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nutritious"
}
        
Elapsed time: 0.69988s