Skip to main content

A library to generate fractals

Project description

FractPy: a python library for generating fractals

License: MIT Documentation Status codecov Code style: black

This library currently implements the generation of following fractals:

  • Newton Fractal
    • For Newton Fractal, this library can currently be used only for polynomial functions with real powers.

FractPy relies on sympy, numpy, and matplotlib - all part of the standard scientific Python stack so is easy to install on all operating systems.

How do I install FractPy?

The recommended way to install fractpy is using Python Package index (PyPi), to install use the following command:

$ pip install fractpy

How do I use FractPy?

Here is an example of generating Newton Fractal for :

from fractpy.models import NewtonFractal
model = NewtonFractal("x**8 - 4x**3 + x**2 - 6")
p = model.plot(-2, 2, -2, 2, (1000, 1000))

The above code will generate the following plot:

Full documentation is available here:

How can I contribute to FractPy?

To install development version of this library:

$ python -m pip install -e ."[dev]"

Before you commit any code:

  • Style your code automatically using black:
$ python -m black -l 79 .
  • Also, please perform the following checks:
$ python -m pytest --flake8

All contributions are welcome, whether it be adding new methods of generating fractals, writing documentation, or fixing embarrassing bugs!

In the interest of fostering an open and welcoming environment, all contributors, maintainers and users are expected to abide by the Python code of conduct:

Getting Help

For more information or to ask questions about FractPy join our Slack Channel.


FractPy is fully open source. For more information about its license, see LICENSE.

Project details

Download files

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

Source Distribution

fractpy-0.0.3.tar.gz (43.5 MB view hashes)

Uploaded source

Built Distribution

fractpy-0.0.3-py3-none-any.whl (10.6 kB view hashes)

Uploaded py3

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