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.

Source Distributions

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

Built Distribution

contextfree-0.3.7-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file contextfree-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: contextfree-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for contextfree-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f0fa28ee162205f5ec4a7fa9f9adea64c2e16e1a73be02566bed67986f396886
MD5 9eeeb3e5290e8d4621ce329cfe7ee891
BLAKE2b-256 137a4cd7cdb964e0eace3e51e85e2bf21dc14fd2bb151b379af061c14323f3fc

See more details on using hashes here.

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