Skip to content

stranskyjan/raphaelpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

from raphaelpy import Raphael

# Creates canvas 320 x 200 at 10, 50
paper = Raphael("drawing.svg", 320, 200)

# Creates circle at x = 50, y = 40, with radius 10
circle = 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 blue
circle.attr("stroke", "#00f")

# Saves the resulting drawing to the file
paper.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

directory content
raphaelpy source code
examples examples how RaphaëlPy works and how to use it
Makefile makefile for the project (with targets help, install, doc, test, clean, dist)
docs source codes to build HTML documentation
tests a few unit tests
setup.py python 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

License

Stars

Watchers

Forks

Packages

No packages published