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
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 | Reset |
|---|---|---|---|---|
| contextfree-0.3.7-py3-none-any.whl | Python 3 | none | any | Details |
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
|