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
-
Using
setup.pyfile:python setup.py install [options], e.g.python setup.py --user -
Using
make(callssetup.pyinternally):make install [options], e.g.make install USER=TRUE PYTHON=python3 -
Using
pip[sudo] pip[3] install [options] raphaelpy, e.g.pip install --user raphaelpyorsudo pip3 install raphaelpyNote: use
pipof Python 2 andpip3for 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
- to Raphaël JavaScript Library for great job and inspiration.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f785d45ef6228dbb43c07f6af562a0bb3baa17252fa5d4effeb5cf6b335488e9
|
|
| MD5 |
d729a5b36579f911a835dd11693305b9
|
|
| BLAKE2b-256 |
685272d021b9252dcc545bc06b9addf98f01e0d25e95b081d425c6e0503e4082
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b74b7188f30bd272f4f8509e4f8663bbd17b503a60e41be8912713b66a37857
|
|
| MD5 |
13f873d8bf4c3237ff6503cbd070fcf0
|
|
| BLAKE2b-256 |
2d5975839c0d01095da21ab6cbbaed396518524e14adce1541a016e598893c77
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ddd99c72809babc487b79fd78e919ee94a368cace3110aa9678f567ce8485eb
|
|
| MD5 |
800d4fe9104de161a31915ca3cd4bb64
|
|
| BLAKE2b-256 |
a057006119429cd91a926f3dcbeb39e7ea4ba06142b6487186bf27b324cc1e69
|