PyCob
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
Learn More
Metadata
Release files for pycob 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycob-0.1.9.tar.gz | 30.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycob-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.0 kB
Release files / pycob-0.1.9.tar.gz
| Download URL | pycob-0.1.9.tar.gz |
|---|---|
| Size | 30.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c510f562ca55e1ed9476c75631e176970185248e21cb48b93efd0d790d01f15c
|
|
BLAKE2b-256 checksum How to use checksums |
b663aaf29eaed23edc1e773532021c51cb922e75cb9460283365c4aa4ed9cd27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / pycob-0.1.9-py3-none-any.whl
| Download URL | pycob-0.1.9-py3-none-any.whl |
|---|---|
| Size | 31.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83fda992926115b59dc5c90274d371cd54ccdac2b08d98b3c62cf30e1eaeb460
|
|
BLAKE2b-256 checksum How to use checksums |
ca1facf5b1a3004e426d8c6438b682ecab3f8fec85d65b74c990f3a0ad48a5b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|