pycontextfree
CFDG-inspired cairo-based pythonic generative art tool
Here is an example of simple code producing stochastic fractal tree:
from contextfree.contextfree import *
@check_limits
def branch():
line(0,1)
with translate(0,0.9):
with scale(0.7 + rnd(0.15)):
with color(alpha=0.95):
with rotate(-0.3 + rnd(0.3)):
branch()
with rotate(0.3 + rnd(0.3)):
branch()
init(canvas_size=(300,300), background_color="#FFFFFF")
with scale(3):
branch()
display_ipython()
Here is the output:
Check examples folder for more fun stuff.
How do I get set up?
pip3 install contextfree for latest stable release
pip3 install git+https://github.com/undertherain/pycontextfree.git for recent development version
Python 3.6 or later is required
Metadata
Release files for contextfree 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| contextfree-0.3.7-py3-none-any.whl | Python 3 | none | any | Details for contextfree-0.3.7-py3-none-any.whl |
Release files / contextfree-0.3.7-py3-none-any.whl
| Download URL | contextfree-0.3.7-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0fa28ee162205f5ec4a7fa9f9adea64c2e16e1a73be02566bed67986f396886
|
|
BLAKE2b-256 checksum How to use checksums |
137a4cd7cdb964e0eace3e51e85e2bf21dc14fd2bb151b379af061c14323f3fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for contextfree 0.3.7
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.