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

Uploaded Source

Built Distribution

pycob-0.1.4-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycob-0.1.4.tar.gz
  • Upload date:
  • Size: 28.7 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.4.tar.gz
Algorithm Hash digest
SHA256 64503d7c762b693382bfccd0c9fd8fc6b19857396c31134ec027e8f410577d9d
MD5 2a6fd631c42f74d0c06ebc0af9d4d660
BLAKE2b-256 9f8773dac9a6ee56b6c6401a188a80a1f87b1765d177d2fa3f8476cd9ce66269

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycob-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 30.1 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 74450fb94c49fac50648ee6515b2f8891af4ff68a239f62d2fc0741963300335
MD5 f58ccbeb1db5ca99bd1af0d66f11f388
BLAKE2b-256 512078211d177e11f4aa76e3af0c90919a17e3cc28c6d564cec9aa13b810d692

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