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.20.tar.gz
(35.4 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.20-py3-none-any.whl
(36.7 kB
view details)
File details
Details for the file pycob-0.1.20.tar.gz.
File metadata
- Download URL: pycob-0.1.20.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4a5c6ca038def0ece519a19185b4aaa87e743a1d75163f5889ffe2f66498a79
|
|
| MD5 |
3706a22bb95a50e15865dcb483eefc99
|
|
| BLAKE2b-256 |
34190077371ee705a2ca124873a591b740f27b09e25c4eb9527d6fca0d339496
|
File details
Details for the file pycob-0.1.20-py3-none-any.whl.
File metadata
- Download URL: pycob-0.1.20-py3-none-any.whl
- Upload date:
- Size: 36.7 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 |
2f4fddeb9552464d33a84118f8ee4469be49af5ae5e7679e91ad09cb406d053d
|
|
| MD5 |
c49e3b64623ce02903b16163959d48fd
|
|
| BLAKE2b-256 |
1042d7e4a95a0f8a3a0c9da3c503bf75f5cafc23fa93e0a1331d53dc3a967c55
|