Skip to main content

cfdg-inspired cairo-based pythonic generative art framework

Project description

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.4 or later is required

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

contextfree-0.2.2-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page