DiamondFire templating library in Python.
Project description
DiamondFire.py
DiamondFire templating library in Python
Installation
The package can be found on PYPI at DiamondFire.py. To install, open terminal and type in:
python3 -m pip --upgrade DiamondFire.py
This will install the package.
Quick Start
The package can be used under the namespace df
. Here's an example program that generate code that counts to 10:
import df
index_variable = df.Variable(df.VariableScope.LINE, "index")
template = df.Template([
df.CodeBlock(df.CodeBlockCategory.PLAYER_EVENT, "Join"),
df.CodeBlock(df.CodeBlockCategory.REPEAT, "Multiple", [index_variable, 10]),
df.Bracket(open=True, repeat=True),
df.CodeBlock(df.CodeBlockCategory.PLAYER_ACTION, "SendMessage", [index_variable]),
df.Bracket(open=False, repeat=True)
])
print(template.compress())
template.send_to_codeclient()
Features
- Templates
- Code Blocks
- Brackets
- CodeClient API
Documentation
I'm too lazy to figure out how to generate doc HTML so the docstring is shown by your IDE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
diamondfire_py-0.0.3.tar.gz
(12.6 kB
view details)
Built Distribution
File details
Details for the file diamondfire_py-0.0.3.tar.gz
.
File metadata
- Download URL: diamondfire_py-0.0.3.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 515fcbdc8e35814514cc55d18f3eda5de8bd60ce44f562788b7c1493f39deacb |
|
MD5 | f0487e1946dfe92bd3cb2f7af5219ba8 |
|
BLAKE2b-256 | 33443903a380711494ab2b5286500a7ac583e7ad12438694e22c4168593ff993 |
File details
Details for the file DiamondFire.py-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: DiamondFire.py-0.0.3-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 691fcc533dff27fadc7d89bde58b3c5c622e8b874451a6cf007c4194ab6d9b1e |
|
MD5 | 4cb3e97206111ecc9c537ccb20d1b2eb |
|
BLAKE2b-256 | ef374cf6f6108c5a073caad47820a5f14f23a455c1f684410918afabeb1e114b |