Skip to main content

cfdg-inspired cairo-based pythonic generative art framework

Project description

build status from Travis CI 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 *

def branch():
    with translate(0,0.9):
        with scale(0.7 + rnd(0.15)):
            with color(alpha=0.95):
                with rotate(-0.3 + rnd(0.3)):
                with rotate(0.3 + rnd(0.3)):

init(canvas_size=(300,300), background_color="#FFFFFF")
with scale(3):


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

Files for contextfree, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size contextfree-0.3.2-py3-none-any.whl (12.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page