Skip to main content
build status from Travis CI https://coveralls.io/repos/github/undertherain/pycontextfree/badge.svg?branch=master pypi version

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:

[tree_example]

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)

Table of built distributions (wheels) for contextfree 0.3.7
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.3.7 This release

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.2

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page