Skip to main content

Library for creating SVG drawings using Python, inspired by RaphaëlJS

Project description

RaphaëlPy

A library for creating SVG drawings using Python.

Overview

It's usage and most of the public API (and obviously it's 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

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

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

raphaelpy-0.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

raphaelpy-0.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

raphaelpy-0.1.0-py2-none-any.whl (17.9 kB view details)

Uploaded Python 2

File details

Details for the file raphaelpy-0.1.0.tar.gz.

File metadata

  • Download URL: raphaelpy-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for raphaelpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca64d859c16460b5d98f181c47fd43209b2c0efd822b35ebbecffad883d59594
MD5 31e64bd27987f534d6df1918e60ce8d2
BLAKE2b-256 cee12560c58fa6b8e0ec49cb21b5b83964093c26ba212d90b7c89e2672065780

See more details on using hashes here.

File details

Details for the file raphaelpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: raphaelpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for raphaelpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a277deb7e71c870de84ede4c1d1f256f3f2905a06340a16f02d3d8eb6af78161
MD5 54ab031689644bb5a404318888c439fa
BLAKE2b-256 847158ea75c7817d60a7349c1c73161e2541304ef084f53dfadb69c84de9dbde

See more details on using hashes here.

File details

Details for the file raphaelpy-0.1.0-py2-none-any.whl.

File metadata

  • Download URL: raphaelpy-0.1.0-py2-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for raphaelpy-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a4c30cca81044305998ff6177fe9bf43a5cdd1c80c98f20f1923c73a58c9763b
MD5 0c2ca4095219c3e1ed57fd3307223aab
BLAKE2b-256 75ae059e7fefbde0dbda0395ebc2ab5dd0af7de45276b2cf7702bd5412fbffe0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page