Skip to content

Latest commit

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

A library for creating SVG drawings using Python.

Overview

Its usage and most of the public API (and obviously its name, too) is strongly inspired by Raphaël JavaScript Library. Some examples and some of the implementation details are borrowed from the original project, too.

See examples to examine how to it works and how to use it.

Compatibility

The package works with both Python 2 and 3 (tested on Ubuntu 18.04 LTS and Python 2.7.15 and Python 3.6.6).

Usage

as simple as:

fromraphaelpyimportRaphael# Creates canvas 320 x 200 at 10, 50paper=Raphael("drawing.svg", 320, 200)
# Creates circle at x = 50, y = 40, with radius 10circle=paper.circle(50, 40, 10)
# Sets the fill attribute of the circle to red (#f00)circle.attr("fill", "#f00")
# Sets the stroke attribute of the circle to bluecircle.attr("stroke", "#00f")
# Saves the resulting drawing to the filepaper.save()

See examples directory for more examples.

Installation

  1. Using setup.py file:

    python setup.py install [options], e.g. python setup.py --user

  2. Using make (calls setup.py internally):

    make install [options], e.g. make install USER=TRUE PYTHON=python3

  3. Using pip

    [sudo] pip[3] install [options] raphaelpy, e.g. pip install --user raphaelpy or sudo pip3 install raphaelpy

    Note: use pip of Python 2 and pip3 for Python 3

What is here

directorycontent
raphaelpysource code
examplesexamples how RaphaëlPy works and how to use it
Makefilemakefile for the project (with targets help, install, doc, test, clean, dist)
docssource codes to build HTML documentation
testsa few unit tests
setup.pypython setup file for installation

Contribution

Pull Requests

Are welcome.

Bug reporting

In case of any question or problem, please leave an issue at the githup page of the project.

Contributors

License

This project is licensed under the LGPL License - see the license file for details.

Acknowledgements

About

Library for creating SVG drawings using Python, inspired by RaphaëlJS<http://dmitrybaranovskiy.github.io/raphael/>

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages