How/where to publish Python package

倖福魔咒の 提交于 2020-12-26 07:46:49

问题


If one creates a useful Python package, how/where does one publish/advertise it for other people to use?

I've put it on hithub, but even Google does not find it after a few weeks. The package is neat & complete, I made it for my personal use and would be a shame not to share it with others :)


回答1:


So, to make the package available to a pip install, you have to register it in the Python Package Index (PyPI): https://pypi.python.org/pypi

There's also the test environment, where you can upload your packages to test if your setup is ok before going to the real deal: https://testpypi.python.org/pypi

You create an account in one of the servers and will be able to upload your package. But, before that, you will have to build your package using setuptools. Here's the documentation for packaging and distributing: https://packaging.python.org/distributing/

The proccess can be little boring, so I wrote a little tool to make it simpler. Maybe it's of some use to you: https://github.com/hugollm/foster




回答2:


Here is the PyPI guide. https://python-packaging-user-guide.readthedocs.org/en/latest/distributing.html

PyPI is the place for putting your Python packages up for others to find. The built-in tool pip references it to install packages for you, and at least one IDE uses pip in the background to give you a GUI for doing this. (PyCharm)



来源:https://stackoverflow.com/questions/30031411/how-where-to-publish-python-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!