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

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

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.2.0.tar.gz (13.9 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.2.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

raphaelpy-0.2.0-py2-none-any.whl (18.3 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: raphaelpy-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for raphaelpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f785d45ef6228dbb43c07f6af562a0bb3baa17252fa5d4effeb5cf6b335488e9
MD5 d729a5b36579f911a835dd11693305b9
BLAKE2b-256 685272d021b9252dcc545bc06b9addf98f01e0d25e95b081d425c6e0503e4082

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raphaelpy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for raphaelpy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b74b7188f30bd272f4f8509e4f8663bbd17b503a60e41be8912713b66a37857
MD5 13f873d8bf4c3237ff6503cbd070fcf0
BLAKE2b-256 2d5975839c0d01095da21ab6cbbaed396518524e14adce1541a016e598893c77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raphaelpy-0.2.0-py2-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for raphaelpy-0.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 7ddd99c72809babc487b79fd78e919ee94a368cace3110aa9678f567ce8485eb
MD5 800d4fe9104de161a31915ca3cd4bb64
BLAKE2b-256 a057006119429cd91a926f3dcbeb39e7ea4ba06142b6487186bf27b324cc1e69

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