Htmlwithpy
Htmlwithpy is a package which allows users to generate html code using python
Installation
Use the package manager pip to install foobar.
pip install htmlwithpy
import htmlwithpy
Usage
Available Tags are
1.body
2.div
3.span
4.p( para)
5.input
6.img
7.a (anchor tag)
Note: While using tags makesure first letter is capital refer to Example code snippets
Constructor
TagName()
None of these attributes are mandatory
Attributes :
- className = String
- id = String
- styleSheet = True or False ( if it is true you will get seperate class for css properties)
import htmlwithpy
inp = htmlwithpy.Input(className="header-img",id = "header-1",styleSheet=True)
Common methods
1.add_content(text : String) : adds text to the tags
2.add_css(property : String, value :String or int : add css property to the tag
3.show_css() : prints all current css properties
4.generate() : Finally generates your tag
Special Methods
1.Input
- add_placeholder(String) : set placeholder of input tag to provided value
- add_value(String) : set value of input tag to provided value
- add_type(String) : set type of input tag to provided value
2.Img
- add_src(String) : set src of img tag to provided value
- add_alt(String) : set alt of input tag to provided value
3.A (anchor)
- add_href(String) : set href of a(anchor) tag to provided value
Examples
import htmlwithpy as hwp
inp = hwp.Input(className="form",styleSheet = True)
inp.add_css("height","100px")
inp.add_css("width","100px")
inp.add_placeholder("placeholder")
inp.generate()
Output :
. form {
height : 100px ;
width : 100px ;
}
import htmlwithpy as hwp
body = hwp.Body()
body.add_css("height","100px")
body.add_css("width","100px")
body.add_content("Test Content")
body.generate()
Output :
Test Content
Metadata
Release files for htmlwithpy 0.0.1
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 | |
|---|---|---|---|---|
| htmlwithpy-0.0.1.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| htmlwithpy-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / htmlwithpy-0.0.1.tar.gz
| Download URL | htmlwithpy-0.0.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e006e77aad912d7c21e6b678e602230f32ada596518140baba72d8a8d392f59c
|
|
BLAKE2b-256 checksum How to use checksums |
ec053141d2d4f86e37df0afdc364182653746fd284f5aa58455acc0fb2dba56a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|
Release files / htmlwithpy-0.0.1-py3-none-any.whl
| Download URL | htmlwithpy-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2138142e46d93e0db3703aceb046f0d4058157c97ff391bfdaa642d0965dac12
|
|
BLAKE2b-256 checksum How to use checksums |
34e40c0144aa75e8c0573881134fb6265aefd577a23f3c10d5b08e43a2343738
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|
Security for htmlwithpy 0.0.1
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.