vdom


Namevdom JSON
Version 1.0.0 PyPI version JSON
download
home_page
Summary
upload_time2023-03-25 23:50:10
maintainer
docs_urlNone
authorKyle Kelley
requires_python>=3.8,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # [VDOM](https://github.com/nteract/vdom)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

## Why use VDOM

- Write **Declarative** Pythonic layouts.
- Create headings, prose, images, and more common user interface items with user-friendly declarative statements.
- Render the layout in _Jupyter_ frontends, such as **nteract** and JupyterLab.
- Serialize the layout for rehydration and later use in your web app.

---

## Check out the power of VDOM

Create layouts by writing and running Python code. Let's see an example
below to create and display a heading, styled prose, and a GIF:

```python
from IPython.display import display
from vdom.helpers import h1, p, img, div, b

display(
    div(
        h1('Our Incredibly Declarative Example'),
        p('Can you believe we wrote this ', b('in Python'), '?'),
        img(src="https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif"),
        p('What will ', b('you'), ' create next?'),
    )
)
```

**Voila!**

Your example created a layout and served it below:

# Now Incredibly Declarative

Can you believe we wrote this **in Python**?

![](https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif)

What will **you** create next?

---

## Getting started

### Install the Python package

```bash
pip install vdom
```

### Usage

First, import `vdom.helpers` for headings, text, and images:

```python
from vdom.helpers import h1, p, img, div, b
```

Create a layout using the VDOM helpers in Python code. Here's an example code
layout block:

```python
my_pretty_layout = div(
    h1('Our Incredibly Declarative Example'),
    p('Can you believe we wrote this ', b('in Python'), '?'),
    img(src="https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif"),
    p('What will ', b('you'), ' create next?'),
)
```

To display the layout, use IPython's display method:

```python
from IPython.display import display


display(my_pretty_layout)
```

The full example, including rendered output, is found [above](#check-out-the-power-of-vdom).

## Documentation

- [Design Patterns](./docs/design-patterns.md)
- [Specification - VDOM Media Type](./docs/mimetype-spec.md)
- [Specification - VDOM Event Support](./docs/event-spec.md)

## Contribute to VDOM

### Developer install from source code

```bash
git clone https://github.com/nteract/vdom
cd vdom
pip install -e .
```

### Contributing Guidelines and Releases

We follow these [Contributing Guidelines](CONTRIBUTING.md).

For contributors helping with creating releases, the [RELEASING.md] document
outlines the process.

## Find out more about nteract

Take a look at the [nteract website](https://nteract.io) to see other projects
that we are working on.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "vdom",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Kyle Kelley",
    "author_email": "rgbkrk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c3/2f/78f3c937c76d96d66dfca461529bbd22c2478146733b749d88eee35e0c55/vdom-1.0.0.tar.gz",
    "platform": null,
    "description": "# [VDOM](https://github.com/nteract/vdom)\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n## Why use VDOM\n\n- Write **Declarative** Pythonic layouts.\n- Create headings, prose, images, and more common user interface items with user-friendly declarative statements.\n- Render the layout in _Jupyter_ frontends, such as **nteract** and JupyterLab.\n- Serialize the layout for rehydration and later use in your web app.\n\n---\n\n## Check out the power of VDOM\n\nCreate layouts by writing and running Python code. Let's see an example\nbelow to create and display a heading, styled prose, and a GIF:\n\n```python\nfrom IPython.display import display\nfrom vdom.helpers import h1, p, img, div, b\n\ndisplay(\n    div(\n        h1('Our Incredibly Declarative Example'),\n        p('Can you believe we wrote this ', b('in Python'), '?'),\n        img(src=\"https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif\"),\n        p('What will ', b('you'), ' create next?'),\n    )\n)\n```\n\n**Voila!**\n\nYour example created a layout and served it below:\n\n# Now Incredibly Declarative\n\nCan you believe we wrote this **in Python**?\n\n![](https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif)\n\nWhat will **you** create next?\n\n---\n\n## Getting started\n\n### Install the Python package\n\n```bash\npip install vdom\n```\n\n### Usage\n\nFirst, import `vdom.helpers` for headings, text, and images:\n\n```python\nfrom vdom.helpers import h1, p, img, div, b\n```\n\nCreate a layout using the VDOM helpers in Python code. Here's an example code\nlayout block:\n\n```python\nmy_pretty_layout = div(\n    h1('Our Incredibly Declarative Example'),\n    p('Can you believe we wrote this ', b('in Python'), '?'),\n    img(src=\"https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif\"),\n    p('What will ', b('you'), ' create next?'),\n)\n```\n\nTo display the layout, use IPython's display method:\n\n```python\nfrom IPython.display import display\n\n\ndisplay(my_pretty_layout)\n```\n\nThe full example, including rendered output, is found [above](#check-out-the-power-of-vdom).\n\n## Documentation\n\n- [Design Patterns](./docs/design-patterns.md)\n- [Specification - VDOM Media Type](./docs/mimetype-spec.md)\n- [Specification - VDOM Event Support](./docs/event-spec.md)\n\n## Contribute to VDOM\n\n### Developer install from source code\n\n```bash\ngit clone https://github.com/nteract/vdom\ncd vdom\npip install -e .\n```\n\n### Contributing Guidelines and Releases\n\nWe follow these [Contributing Guidelines](CONTRIBUTING.md).\n\nFor contributors helping with creating releases, the [RELEASING.md] document\noutlines the process.\n\n## Find out more about nteract\n\nTake a look at the [nteract website](https://nteract.io) to see other projects\nthat we are working on.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "1.0.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bab6d3d3ebefdb0a6bd50358e8ede6f106ca370f4e873996d4090032ee49c42d",
                "md5": "8f88867b4579cbb99d7ca3e7db26603e",
                "sha256": "c57cacb34842c9bf1bde6206e2015876be6f5f3eceead8d167556a9e0acc4faf"
            },
            "downloads": -1,
            "filename": "vdom-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f88867b4579cbb99d7ca3e7db26603e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 22361,
            "upload_time": "2023-03-25T23:50:08",
            "upload_time_iso_8601": "2023-03-25T23:50:08.478955Z",
            "url": "https://files.pythonhosted.org/packages/ba/b6/d3d3ebefdb0a6bd50358e8ede6f106ca370f4e873996d4090032ee49c42d/vdom-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c32f78f3c937c76d96d66dfca461529bbd22c2478146733b749d88eee35e0c55",
                "md5": "c1a8045db1a6259b92c244263ae61e30",
                "sha256": "953d33c0b5cc6e7fec57b350c18bfd31b40439b88671661b6f86f77a42a5aeab"
            },
            "downloads": -1,
            "filename": "vdom-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c1a8045db1a6259b92c244263ae61e30",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 21143,
            "upload_time": "2023-03-25T23:50:10",
            "upload_time_iso_8601": "2023-03-25T23:50:10.991979Z",
            "url": "https://files.pythonhosted.org/packages/c3/2f/78f3c937c76d96d66dfca461529bbd22c2478146733b749d88eee35e0c55/vdom-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-25 23:50:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "vdom"
}
        
Elapsed time: 0.07876s