使创建库并将其上载到pypi变得容易的库
libmaker的Python项目详细描述
你花了好几个小时寻找如何创建和更新pip库的方法了吗?好吧,别再找了!libmaker可以很容易地将代码上传到pip。请注意,您需要一个PIP帐户。
安装
像pip install LibraryMaker一样简单,或者您可以用右边的按钮下载它,解压缩它,进入目录,然后运行python setup.py install
用法
导入库libmaker,然后使用如下所示的创建和更新功能
create:create(名称、路径到代码、描述、版本、用户名、密码、自述文件='',关键字=[])
顾名思义,create函数创建一个库。基本示例用法如下所示。
^{tt3}$
^{tt4}$
您还可以添加额外的参数,如自述文件(长描述)和特殊的关键字列表,以便可以找到您的库。示例用法如下:
^{tt3}$
^{tt6}$
^{tt7}$
以下是所需参数的列表及其作用:
name - The name of your library. Will not work if you use a name that already exists.
path_to_code - The absolute path to your code. This is the code that will be in your library
description - A short description of your library
version - The first version of your library (a string)
username - Your pip account username
password - Your pip account password
下面是标志(非必需参数)的列表及其作用:
readme - A multiline string of ReStructuredText that will be displayed on your pip homepage
keywords - A list of keywords that will be used to help find your library when people search for it
update:update(名称、路径到代码、版本、用户名、密码、自述文件='以前是什么',关键字=['以前是什么',说明='以前是什么')
update函数更新库。确保您与创建库时位于同一目录中。基本用法如下所示。
^{tt3}$
^{tt9}$
这将用新代码更新pypi。您还可以进行其他更改,如下所示。
^{tt3}$
^{tt11}$
以下是所需参数的列表:
name - The name of your library, you may not change it or it won’t work
path_to_code - The path to your python code
version - Your new version (if it was 0.1, you need to change it to 0.2 for it to work)
username - Your pip account username
password - Your pip account password
下面是非必需参数的列表
readme - A multiline string of ReStructuredText that will be displayed on your pip homepage. You may make changes from the previous updates
keywords - A list of keywords that will be used to help find your library when people search for it. You may make changes from the previous updates
description - A short description of your library. You may change this from the previous updates