Giter Club home page Giter Club logo

raphaelpy's Introduction

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

raphaelpy's People

Contributors

stranskyjan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

piupom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.