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

  3. Using pip

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

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.1.tar.gz (13.5 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.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

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

Uploaded Python 2

File details

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

File metadata

  • Download URL: raphaelpy-0.1.1.tar.gz
  • Upload date:
  • Size: 13.5 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.1.tar.gz
Algorithm Hash digest
SHA256 df250cf2a219a38b17a5e55d7e4ecef0df885e69e0937d1161e0845b3a058cb6
MD5 57b0b6243495baeab187fac9f13c57bd
BLAKE2b-256 9956285d899535da35763319729ced50424c0cdd8effb0c500f21d1be79458af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raphaelpy-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98ed0247fd8ac37748159deee330e15842d1368b8a32c2fa2984a46445b45534
MD5 13c0757cb4af23dab38481d575b3bcc0
BLAKE2b-256 e2be4bb399ee675d025afcd4cf1f9c7c05bada432ebb05114973544466d12ba5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raphaelpy-0.1.1-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.1-py2-none-any.whl
Algorithm Hash digest
SHA256 05c7d97210ced9aa4f12694a63ec018f6885ffd1e0c25b616df80d8a66a213f0
MD5 72d01e30961a1119b97622d654968158
BLAKE2b-256 77ad6a638a5da8281ab0d194f48e3c3838378c138a8ec98ef50e2db735294f0f

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