Skip to main content

Build web apps using just Python

Project description

PyCob

PyPI version

Screenshot of PyCob Quickstart App

Create web apps using just Python

Install PyCob

pip install pycob

Use PyCob

import pycob as cob
import pandas as pd

# Create a PyCob app
app = cob.App('Sample App')

# Define a page
def sample_page(server_request: cob.Request) -> cob.Page:
    name = server_request.get_query_parameter('name')
    
    page = cob.Page('Sample Page')

    if name != "":
        page.add_header("Hello, " + name)
    else:
        page.add_header('Sample Header')

    page.add_text('Sample Text')
    page.add_alert('Sample Alert', "Sample Badge")
    
    card = page.add_card()
    card.add_header("Sample Card", size=3)

    form = card.add_form(action="/")
    form.add_formtext('Name', 'name', 'Enter your name')
    form.add_formsubmit('Submit')

    data = {
        "data_int": [420, 380, 390],
        "data_float": [50.2, 39.6, 100.3],
        "large_numbers": [123123.123, 12312512.123, 113453252334.123],
    }

    df = pd.DataFrame(data)

    page.add_pandastable(df)

    return page

# Register page functions with the app
app.register_function(sample_page)

# Run the server
server = app.run()

Quickstart

Quickstart Template Repo

Learn More

PyCob

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

pycob-0.1.23.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

pycob-0.1.23-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file pycob-0.1.23.tar.gz.

File metadata

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

File hashes

Hashes for pycob-0.1.23.tar.gz
Algorithm Hash digest
SHA256 dd33414d7b2f768f56a0c8bd8f7dad1dd87d9d4db83ee14281192c2945c58472
MD5 01ff2528fdbf6f5c9539b929717e149b
BLAKE2b-256 ac52d335d59a1648503bdeb0624380659ad4c202274fd5a2f8fcaf616b7e0e37

See more details on using hashes here.

File details

Details for the file pycob-0.1.23-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pycob-0.1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 0a450e5b5ce9935cea70fb689e9d21d6c528ad4f1e3bb4575e792ddd8199d383
MD5 d4f48c6a5f9d554c8b7bc23553518a3b
BLAKE2b-256 d42b62099206c554532555caf351c7908807c6198c9b257d647891776d782662

See more details on using hashes here.

Supported by

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