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
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.15.tar.gz
(33.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pycob-0.1.15-py3-none-any.whl
(34.3 kB
view details)
File details
Details for the file pycob-0.1.15.tar.gz.
File metadata
- Download URL: pycob-0.1.15.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59176750c3c7703429831fe2bd3d2e770ccfba01b42d7d2d059bda6ca416fdea
|
|
| MD5 |
64bfcbcf31decc78e4190e61dfb50fcd
|
|
| BLAKE2b-256 |
4bfdc95de4f827ae00ac485ec1cd65a68b3fad43fa3b1e5f1680537f9697550f
|
File details
Details for the file pycob-0.1.15-py3-none-any.whl.
File metadata
- Download URL: pycob-0.1.15-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8bf3bac1ec220108fea98a15263ce4da9a660b20480d2b30bb3180a711e1a7c
|
|
| MD5 |
f297499b52d6da1c838729cc91f14b3d
|
|
| BLAKE2b-256 |
d4f5a187c57afb5e2c619f2ab597d34aaaf5e0f9cb0fbc3e1df0c3988ca47b32
|