• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

plantumlcli: Python cli and package interface for local and remote plantuml

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

plantumlcli

开源软件地址:

https://gitee.com/hansbug/plantumlcli

开源软件介绍:

plantumlcli

PyPIPyPI - Python VersionPyPI - ImplementationLocComments

Docs DeployCode TestBadge CreationPackage Releasecodecov

GitHub starsGitHub forksGitHub commit activityGitHub issuesGitHub pullsContributorsGitHub license

An easy-to-use plantuml cli for everyone.

Install

Install from official pypi

pip install plantumlcli

Install from source code

git clone https://github.com/HansBug/plantumlclicd plantumlcli && pip install .

Python 3.6+ is required, pypy is also tested to be okay.

Using with cli

Basic Usage

Show version of plantumlcli

plantumlcli -v

Show help information of plantumlcli

plantumlcli -h

Check the local plantuml environment and remote plantuml host

plantumlcli -c   # check both environmentsplantumlcli -cL  # check local environment onlyplantumlcli -cR  # check remote environment only

In default, no local plantuml jar can be used, the remote host is set to the official one (http://www.plantuml.com/plantuml). But don't worry, you can specify your plantuml jar file or remote host by environment variables or command lines.

plantumlcli -c                                             # local not okay, remote okayPLANTUML_HOST=http://plantuml.example.com plantumlcli -cR  # remote okayplantumlcli -cR -r http://plantuml.example.com             # remote okayPLANTUML_JAR=/my/path/plantuml.jar plantumlcli -cL         # local okayplantumlcli -cL -p /my/path/plantuml.jar                   # local okay

Build image from plantuml source code

plantumlcli source.puml                # the target image will be named as 'source.png'plantumlcli -o image.png source.puml   # the target image will be named as 'image.png'plantumlcli -t eps source.puml         # eps format is supportedplantumlcli source1.puml source2.puml  # 2 source codes, the images' names will be 'source1.png' and 'source2.png'plantumlcli -o image1.png -o image2.png source1.puml source2.puml  # 2 source codes, image will be 'image1.png' and 'image2.png'PLANTUML_JAR=/my/path/plantuml.jar plantumlcli source.puml     # use local plantuml jar to build pngPLANTUML_JAR=/my/path/plantuml.jar plantumlcli -L source.puml  # force use local plantuml jar to build pngPLANTUML_HOST=http://plantuml.example.com plantuml source.puml     # use your plantuml host to build pngPLANTUML_HOST=http://plantuml.example.com plantuml -R source.puml  # force use your plantuml host to build png

You can also get the URL address of remote plantuml (in these cases, remote plantuml will be used regardless of -L and -R commands)

plantumlcli -u helloworld.puml              # get png URL of helloworld.pumlplantumlcli -u -t eps helloworld.puml       # get eps URL of helloworld.pumlplantumlcli --homepage-url helloworld.puml  # get online editor's URL of helloworld.pumlplantumlcli -u helloworld.puml common.puml  # get png URL of the 2 puml files (one line for one URL, in order)

Using from python

You can also use plantumlcli in python source code by import

# environment variables# PLANTUML_JAR=/path/to/plantuml.jar# PLANTUML_HOST=https://plantuml.example.comfrom pathlib import Pathfrom plantumlcli import LocalPlantuml, RemotePlantumlif __name__ == "__main__":    code = Path('source.puml').read_text()    local = LocalPlantuml.autoload()    print(local.dump_txt(code))                           # print text graph of code    local.dump('/my/path/source_local.png', 'png', code)  # save png to /my/path/source_local.png    local.dump('/my/path/source_local.eps', 'eps', code)  # save eps to /my/path/source_local.eps    remote = RemotePlantuml.autoload()    print(remote.dump_txt(code))                            # print text graph of code    remote.dump('/my/path/source_remote.png', 'png', code)  # save png to /my/path/source_remote.png    remote.dump('/my/path/source_remote.eps', 'eps', code)  # save eps to /my/path/source_remote.eps    print(remote.get_url('png', code))                      # get png url from remote host    print(remote.get_homepage_url(code))                    # get online editor's url from remote host

Contributing

Thank you for considering contributing to plantumlcli!

We appreciate all contributions to improve plantumlcli, both logic and system designs. Please refer to CONTRIBUTING.md for more guides.

And users can join our slack communication channel, or contact the core developer HansBug for more detailed discussion.

Links

Github: https://github.com/HansBug/plantumlcli

Documentation(just readme yet, will be written soon): https://github.com/HansBug/plantumlcli/blob/main/README.md

Issue Tracker: https://github.com/HansBug/plantumlcli/issues

Pypi: https://pypi.org/project/plantumlcli/

Test pypi(pre-released versions can be found here): https://test.pypi.org/project/plantumlcli/

Change log

Version 0.0.3

Released 2021-10-8

  • Fix the problem when using official site.
  • click version requirement changed to >= 7.0, will not conflict with other packages any more.

Version 0.0.2

Released 2020-11-30

Version 0.0.1

Released 2020-11-29

  • The first official plantumlcli version, cheers!!! :beers:

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
AndroidMediaCodec: Android H264编解码发布时间:2022-03-25
下一篇:
ScreenShare: JAVA实现的桌面共享程序发布时间:2022-03-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap