Skip to main content

Build web apps using just Python

Project description

PyCob

PyCob Logo on Hexagon

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 the page
def test_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

# Give the page a route
app.add_page('/', "Home", test_page)

# Run the 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.6.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

pycob-0.1.6-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycob-0.1.6.tar.gz
  • Upload date:
  • Size: 29.2 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.6.tar.gz
Algorithm Hash digest
SHA256 506e3004249b5aa1d15e6bd30ae7eb7e9b5109e4e7404738d8f8dd454d6f7a03
MD5 2747a069388f57687186f167a64dd482
BLAKE2b-256 9976ddfedfd0ccf0519639aa1d754285de759dd506b577a20058fdeb6003ccf7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycob-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 30.6 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 32ec6b0c54472acb3f956bb1370c94cc9868ed4d1f009853886634f2b08abe86
MD5 5f8c77c30e937a9eda4e959ac210424c
BLAKE2b-256 fbab970a23ee3eebe8e7ce877e96e39ae641795df7a743efdfe4f2b87df3f804

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page