{ "info": { "author": "Bruce Wayne", "author_email": "bruce.wayne@example.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6" ], "description": ".. image:: https://travis-ci.org/bast/somepackage.svg?branch=master\n :target: https://travis-ci.org/bast/somepackage/builds\n.. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg\n :target: ../master/LICENSE\n\n\nSomepackage\n===========\n\nShow how to structure a Python project.\n\nInspired by https://github.com/kennethreitz/samplemod.\n\n\nRecommendations\n===============\n\n\nPython 2 or 3?\n--------------\n\n- Develop your code under Python 3, test it for both Python 2 and Python 3\n but consider Python 3 to be the default today.\n\n\nSplit your code into packages, modules, and functions\n-----------------------------------------------------\n\n- All code should be inside some function (except perhaps ``if __name__ == '__main__':``).\n- Split long functions into smaller functions.\n- If you need to scroll through a function over several screens, it is probably too long.\n- Hide internals with underscores.\n- Organize related functions into modules.\n- If modules grow too large, split them.\n- Import from other modules under ``somepackage/`` using ``from .somemodule import something``.\n- Do file I/O on the \"outside\" of your code, not deep inside.\n\n\nNaming\n------\n\n- Give the subdirectory the same name as your package.\n- Before you name your package, check that the name is not taken on https://pypi.org\n (you may want to upload your package to PyPI one day).\n\n\nInterfaces\n----------\n\n- In ``somepackage/__init__.py`` define what should be visible to the outside.\n- Use https://semver.org.\n\n\nTesting\n-------\n\n- Test all non-trivial code. I recommend to use https://pytest.org.\n- Use Travis CI: https://docs.travis-ci.com/user/languages/python/.\n\n\nDependency management\n---------------------\n\n- Package dependencies for developers should be listed in ``requirements.txt``.\n- Package dependencies for users of your code (who will probably install via pip) should be listed in ``setup.py``.\n\n\nCode style\n----------\n\n- Follow PEP8: https://www.python.org/dev/peps/pep-0008/\n- Use ``pycodestyle`` to automatically check for PEP8.\n- Consider using type hints: https://docs.python.org/3/library/typing.html\n- Consider verifying type annotations at runtime: https://github.com/RussBaz/enforce\n\n\nShare your package\n------------------\n\n- Choose a license and add a LICENSE file.\n- Share your package on PyPI. For this you can follow https://github.com/bast/pypi-howto.\n\n\nDocumentation\n-------------\n\n- Use RST for your README (to make it easier for https://pypi.org).\n\n\nSuggestions? Corrections? Pull requests?\n----------------------------------------\n\nYes please!", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bast/somepackage", "keywords": "", "license": "MPL-2.0", "maintainer": "", "maintainer_email": "", "name": "somepackage", "package_url": "https://pypi.org/project/somepackage/", "platform": "", "project_url": "https://pypi.org/project/somepackage/", "project_urls": { "Homepage": "https://github.com/bast/somepackage" }, "release_url": "https://pypi.org/project/somepackage/1.2.3/", "requires_dist": null, "requires_python": "", "summary": "Show how to structure a Python project.", "version": "1.2.3" }, "last_serial": 3560361, "releases": { "1.2.3": [ { "comment_text": "", "digests": { "md5": "144abedb77bcd7d9a010fe105bb3bf7f", "sha256": "274f83dcf6110c8ecd21e7b8c9b2907274a1170830875738fda167e611143077" }, "downloads": -1, "filename": "somepackage-1.2.3.tar.gz", "has_sig": false, "md5_digest": "144abedb77bcd7d9a010fe105bb3bf7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8604, "upload_time": "2018-02-07T13:57:04", "url": "https://files.pythonhosted.org/packages/81/f6/cdc617199548a495fd034a4128bb33b35857d2ddb97ddf25c4f29302569e/somepackage-1.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "144abedb77bcd7d9a010fe105bb3bf7f", "sha256": "274f83dcf6110c8ecd21e7b8c9b2907274a1170830875738fda167e611143077" }, "downloads": -1, "filename": "somepackage-1.2.3.tar.gz", "has_sig": false, "md5_digest": "144abedb77bcd7d9a010fe105bb3bf7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8604, "upload_time": "2018-02-07T13:57:04", "url": "https://files.pythonhosted.org/packages/81/f6/cdc617199548a495fd034a4128bb33b35857d2ddb97ddf25c4f29302569e/somepackage-1.2.3.tar.gz" } ] }