受rapha_ljs启发,使用python创建svg图形的库

raphaelp的Python项目详细描述


RaphaëlPy

使用python创建svg图形的库。

概述

它的使用和大多数公共api(当然还有它的名字)都受到了Raphaël JavaScript Library的强烈启发。 一些示例和一些实现细节也是从原始项目中借用的。

请参阅examples以检查它如何工作以及如何使用它。

兼容性

这个包同时适用于python 2和3(在Ubuntu 18.04 LTS和python2.7.15以及python 3.6.6上测试)。

用法

简单到:

fromraphaelpyimportRaphael# Creates canvas 320 x 200 at 10, 50paper=Raphael("drawing.svg",320,200)# Creates circle at x = 50, y = 40, with radius 10circle=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 bluecircle.attr("stroke","#00f")# Saves the resulting drawing to the filepaper.save()

有关更多示例,请参见examples目录。

安装

  1. 使用setup.py文件:

    python setup.py install [options],例如python setup.py --user

  2. 使用make(内部调用setup.py):

    make install [options],例如make install USER=TRUE PYTHON=python3

  3. 使用^{}

    [sudo] pip[3] install [options] raphaelpy,例如pip install --user raphaelpysudo pip3 install raphaelpy

    Note: use pip of Python 2 and pip3 for Python 3

这里是什么

directorycontent
raphaelpysource code
examplesexamples how RaphaëlPy works and how to use it
Makefilemakefile for the project (with targets ^{}, ^{}, ^{}, ^{}, ^{}, ^{})
docssource codes to build HTML documentation
testsa few unit tests
setup.pypython setup file for installation

贡献

拉取请求

很受欢迎。

错误报告

如有任何疑问或问题,请在githup page of the project留言。

贡献者

许可证

此项目是根据lgpl许可证授权的-有关详细信息,请参见license file

致谢

  • 为了伟大的工作和灵感。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将springboot war部署到debian jetty8   java破坏了函数,即使它看起来是正确的   当MockMvc不可自动编译时,java会有选择地从Spring Security向其应用单个过滤器   java AndroidStudio每秒播放n次生成的声音   JavaJBossSeam:继承的方法被拦截了吗?   ScheduledExecutorService中线程默认名称中池号的java含义   在Java中用递归方法实现类Fibonacci的递归   java虚拟路径/文件夹   java即时与ZoneDateTime。转换到另一时区   用GaussLegendre算法在java中逼近Pi   java RecyclerView findFirstVisibleItemPosition()返回1   java根据当前经过身份验证的用户的角色返回不同的JSON对象   java从内部类访问扩展类的方法   Android程序中的Java语法WRT静态方法   可选参数初始化Java字符串文字时出错