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.16.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

pycob-0.1.16-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycob-0.1.16.tar.gz
  • Upload date:
  • Size: 33.1 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.16.tar.gz
Algorithm Hash digest
SHA256 427f6aca663ec648eb93f8cd91404e9e9d7e68233770657f47bb462845d3e92a
MD5 9289af7b39ad8758310b7929d515fc43
BLAKE2b-256 bbd74d3ee9e2a218b577838cf8594a7fcef4ea308f32a6bfff7e9762278e12f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycob-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 34.3 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.16-py3-none-any.whl
Algorithm Hash digest
SHA256 3edc822eaebad2dd9d3c06b3d0fa8b2447ef3b93ad206f8c21433c26a39f3d7f
MD5 f8645d64feb7b4be2645c14f6ebd5ca4
BLAKE2b-256 2965018728dac73ff34ece75b187a2e9e34ea70c50e0c6f89b8b8da276c3c434

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