{ "info": { "author": "mwtmurphy", "author_email": "mwtmurphy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# Overview\n\nThis repo is for creating best practice python packages. Marco Bonzanini's [definition](https://marcobonzanini.com/2015/07/01/how-to-develop-and-distribute-python-packages/) of a package is as follows:\n\n> In Python, a simple source file containing the definitions of functions, classes and variables, is a module... On the other side, a package is a folder containing an \\_\\_init\\_\\_.py file, as well as other different Python source files. Typically a package contains several modules and sub-packages.\n\nThis repo assumes you have understanding how to set up a Python Module and have done so before going any further.\n\n\n# Unit Testing\n\nFor unit testing, Dive Into Python 3's example of [unit testing](http://www.diveintopython3.net/unit-testing.html) is a great resource. It's a simple Roman Numeral conversion example that walks you through the bulk of what you'll need to know.\n\n\n# Logging\n\nShould an error occur when the package is live, logs are a great method to provide information to stdout. Jorgen Schaefer's [guide to logging](https://www.loggly.com/ultimate-guide/python-logging-basics/) establishes logging convention, and the developer's role.\n\nAs logging doens't function part of the example 'maths' module, I'm currently of the opinion that it can be kept in a seperate utils module\n\n\n# Error Handling\n\nNaturally this moves us on to custom error handling where Aaron Maxwell's [exceptional logging of exceptions](https://www.loggly.com/blog/exceptional-logging-of-exceptions-in-python/) article takes centre stage. It's a moderate advancement on the error handling you were used to in the unit testing example, but does allow us to capture and relay traceback information in defined patterns.\n\nIt additionally defines anti-patterns for which neither the Unit Testing or Loggging links provide, i.e. what is considered unacceptable logging.\n\n### Notes \n\n* This tutorial assumes you know about Python classes. If not, look no further than Python's [classes tutorial](https://docs.python.org/3/tutorial/classes.html)\n\n* 'exc_info' returns 'NoneType: None' should 'if else raise' statements be performed. \n\n\n# Creating a Package\n\n* Python's own [packaging tutorial](https://packaging.python.org/tutorials/distributing-packages/) covers the basic scaffolding.\n* Peter Downs' article on [getting setup with PyPI](http://peterdowns.com/posts/first-time-with-pypi.html). It solves some of the problems around uploading packages to PyPI not covered in the packaging tutorial, and shows you how to avoid repetitive authentication with (admittedly) a plain text file.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mwtmurphy/python-plugins", "keywords": "example plugin", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "example_maths", "package_url": "https://pypi.org/project/example_maths/", "platform": "", "project_url": "https://pypi.org/project/example_maths/", "project_urls": { "Homepage": "https://github.com/mwtmurphy/python-plugins" }, "release_url": "https://pypi.org/project/example_maths/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "example python package performing addition", "version": "0.1.1" }, "last_serial": 3073413, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "d0073df9bbd56bc2011992ee7b56459c", "sha256": "aef659a5d6ebf031772495df57a0f1a1024fde09a57fcecdf6aa6368ca7b6ec0" }, "downloads": -1, "filename": "example_maths-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d0073df9bbd56bc2011992ee7b56459c", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7596, "upload_time": "2017-08-04T18:55:08", "url": "https://files.pythonhosted.org/packages/24/6d/8d1878bcbe86ea957584de68dac15b64bb5ea4fc39a16e62ffaa96876387/example_maths-0.1.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0073df9bbd56bc2011992ee7b56459c", "sha256": "aef659a5d6ebf031772495df57a0f1a1024fde09a57fcecdf6aa6368ca7b6ec0" }, "downloads": -1, "filename": "example_maths-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d0073df9bbd56bc2011992ee7b56459c", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7596, "upload_time": "2017-08-04T18:55:08", "url": "https://files.pythonhosted.org/packages/24/6d/8d1878bcbe86ea957584de68dac15b64bb5ea4fc39a16e62ffaa96876387/example_maths-0.1.1-py3-none-any.whl" } ] }