pycoyote - A Python library for building Web user interfaces
Define your component
# You define a class derived from Component
# You need to implement method render
# You can access self.children which represent all the children of your component
# You can access self.props which contains all the attributes passed to your component
# You can import HTML tags from Component, for example "from pycoyote import DIV"
from pycoyote import Component, DIV, SPAN
class MainPage(Component):
def render(self):
return DIV(
SPAN({"class": "bold", "style": f"background-color: {self.props['color']};"},
"Hello world!"
),
*self.children
)
Using your component
# You can pass attributes to your component
# You can pass children to your component
MainPage({"color": "green"},
SPAN("Example ends here.") # you can pass as much child as you need
)
Examples
Please check Examples for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycoyote-0.0.8.tar.gz
(6.2 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
File details
Details for the file pycoyote-0.0.8.tar.gz.
File metadata
- Download URL: pycoyote-0.0.8.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82dfbaf80ef67052645fcc9bc2e310a32e4c3c3a890246dcd963dc2eb0e91143
|
|
| MD5 |
b0c9e09ed66cdc1549043f0862826e9f
|
|
| BLAKE2b-256 |
e7b3acd337e4c1dd327e30e39ec2f54c7e9a3e1b49dca0e0c9d570782d1e53a3
|
File details
Details for the file pycoyote-0.0.8-py3-none-any.whl.
File metadata
- Download URL: pycoyote-0.0.8-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f48d63884a0df7f93a57e9ebeee8f3148907a13f2f120846e32794382c8593c2
|
|
| MD5 |
35f14479310fbecd58049b60bfdca339
|
|
| BLAKE2b-256 |
2c90e4a225e66bb09289a4f8adbb7504f9d223556adfa8e6a8387869bf523032
|