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.6 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.

Filename, size & hash SHA256 hash help File type Python version Upload date
contextfree-0.2.3-py3-none-any.whl (8.4 kB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page