Skip to main content

Easily create styled web pages with Python

Project description

PyVibe

https://www.pyvibe.com/ | Examples | Use With Flask | Live Playground | Component Reference |

PyVibe logo with sample code

Easily create styled web pages with Python

import pyvibe as pv

page = pv.Page()

page.add_header("Welcome to PyVibe!")

page.add_text("PyVibe is an open source Python library for creating UI components for web apps without the need to write HTML code.")

See all components

Interactive playground

What is PyVibe?

PyVibe is a Python library for creating web pages. It is designed to be a quick way for Python developers to build front-ends.

PyVibe uses a component-based approach to building web pages. This means that you can create a page by combining components together.

How do I use PyVibe?

PyVibe is a Python library that simplifies UI development for web apps by providing semantic Python components that compile into HTML and can be used with any web framework.

Fundamentally, PyVibe returns an HTML string that can be used with:

  • Static Pages: Using .to_html()
  • Flask: Inside a Flask function
  • Pyodide: For dynamic client-side rendered pages (experimental)

What can you build with PyVibe?

More Examples

Designed for Autocomplete

PyVibe is designed to be used with autocomplete. This means that you can type page.add_ and autocomplete will show you all the components that you can add to your page along with documentation about the component.

Example showing how autocomplete works

Themes

PyVibe is meant to be a generic framework. While the default theme uses Flowbite, which are components that use TailwindCSS, we envision including many themes and CSS frameworks in the future.

How does PyVibe compare to Streamlit, Plotly Dash, Pynecone, Anvil, NiceGUI, etc?

PyVibe is not a web server -- it produces styled HTML that can be used with any web server.

Getting Started

  • To get started with PyVibe, simply install the library using pip:
pip install pyvibe

Once installed, you can begin creating UI components by creating a new Page object and adding components to it using the .add_* methods. You can then return the page as HTML by calling page.to_html().

For example, to create a new page with a header and a paragraph of text, you could use the following code:

import pyvibe as pv

page = pv.Page()
page.add_header("Welcome to PyVibe!")
page.add_text("PyVibe is a Python library for creating UI components for web apps without the need to write HTML code.")
print(page.to_html())

This will output the following HTML (simplified for readability but it also includes the rest of the HTML document including a navbar, footer, head tag, etc):

<div id="page-container" class="container px-5 my-5 mx-auto">
    <p class="mb-4 font-extrabold leading-none tracking-tight text-gray-900 dark:text-white  text-xl sm:text-5xl ">Welcome to PyVibe!</p>
<p class="mb-6 text-lg font-normal text-gray-500 lg:text-xl dark:text-gray-400">PyVibe is a Python library for creating UI components for web apps without the need to write HTML code.</p> 
</div>

Contributions

PyVibe is an open-source library, and contributions are welcome! If you have an idea for a new feature or theme, or if you find a bug and want to submit a fix, feel free to open a pull request.

Thanks for considering PyVibe!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvibe-0.0.5.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

pyvibe-0.0.5-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file pyvibe-0.0.5.tar.gz.

File metadata

  • Download URL: pyvibe-0.0.5.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyvibe-0.0.5.tar.gz
Algorithm Hash digest
SHA256 834cc33ce324cac7a43ef564328de9bc36d951d6aa5d3f534df4ef8d8c978323
MD5 643e3de6e219a1f3acf0afaf1b9ad4a9
BLAKE2b-256 b23a9184ec3f5fe74c6785059f46b679ddb3e0dc698719238feda9a48fe4d881

See more details on using hashes here.

File details

Details for the file pyvibe-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pyvibe-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyvibe-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eee7bd0491c215da90586476bff3c3ec4655c5de78110ec7d5e1ed6578734c8e
MD5 251dcb9eaae910edfaef91b2972bc774
BLAKE2b-256 c6f2c7a8db3e9b97fc6f8dbd96d2451bce37dcdfc2b1078fb04193be72f37803

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page