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

Uploaded Source

Built Distribution

pycob-0.1.21-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycob-0.1.21.tar.gz
  • Upload date:
  • Size: 35.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.21.tar.gz
Algorithm Hash digest
SHA256 898c5e8261112ad645744675a3e2cb8758147966072b6552a3cc5a0d29e1bf39
MD5 b228518cdb1d5a5243317f1b900c7138
BLAKE2b-256 14bb903c77f8e3afca4813555e126f3598810543f5dd661b6dfff81942a58607

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycob-0.1.21-py3-none-any.whl
  • Upload date:
  • Size: 37.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.21-py3-none-any.whl
Algorithm Hash digest
SHA256 41350979b61d1b97bfef7a8a1f14afda9c1bf0e95e40a22e6a4b0c434de4cd63
MD5 5b505fd07e5282b40391a42a9b7baacd
BLAKE2b-256 c42e5c0f63af14f4de9b3ad0b6764bcac19e8105f2321e2a2744f772ccff1caf

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