This release is a pre-release and may not be stable for production use.
💧 PH7
Why PH7?
- Native to python
- More code modularity
- Easy to write reusable components
- Out of the box editor support
- Syntax highlighting
- Code navvigation tools
- Auto-completion
- Type safety using MyPy
Install
pip3 install ph7
Quickstart
Write your first block of markup
from ph7.html import body, div, html
template = html(
body(
div(
"Hello, World!",
)
)
)
print(template)
<html>
<body>
<div>Hello, World!</div>
</body>
</html>
Or write a CSS class
from ph7.css import CSSObject
class flex_center(CSSObject):
"""Flex center"""
display = "flex"
align_items = "center"
justify_content = "center"
print(flex_center())
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
Or use python function as JavaScript function
from ph7.js import as_js, console, document, fetch
async def fetchDog():
response = await fetch(
"https://dog.ceo/api/breeds/image/random",
{"method": "GET"},
)
if response.status != 200:
response_body = await response.text()
console.log(f"Error fetching dog; {response_body}")
return
data = await response.json()
document.getElementById("image").src = data.message
print(as_js(fetchDog))
async function fetchDog() {
let response = await fetch('https://dog.ceo/api/breeds/image/random', {
'method': 'GET'
});
if (response.status != 200) {
let response_body = await response.text();
console.log('Error fetching dog; ' + response_body);
return;
};
let data = await response.json();
document.getElementById('image').src = data.message;
};
PH7 is still in beta-development. It will be production ready with following enhancements
- Remove performance bottlenecks
- Unit testing support
Further improvements
- Typed context for type safety
Links:
Metadata
Release files for ph7 0.1.0rc5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ph7-0.1.0rc5.tar.gz | 43.6 kB | Without provenance | Details for ph7-0.1.0rc5.tar.gz |
Release files / ph7-0.1.0rc5.tar.gz
| Download URL | ph7-0.1.0rc5.tar.gz |
|---|---|
| Size | 43.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69ca2b5561ea66c3852f0caa38dd2fc360bcce361149e56c988af3955b13b25b
|
|
BLAKE2b-256 checksum How to use checksums |
d4b54045fc87e9ffbe5e1a332697afb0a5844df669dac9c7a2af6d365c10ae8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for ph7 0.1.0rc5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.