{ "info": { "author": "Craig Hurd-Rindy", "author_email": "gnuworldman@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Utilities" ], "description": "The pyneric package provides generic Python utilities and extensions.\n\nThe `source `_,\n`documentation `_,\nand `issues `_\nare hosted on `GitHub `_.\n\nThis is an open-source project by and for the community. Contributions,\nsuggestions, and questions are `welcome `_\n(Twitter: @bravegnuworld).\n\n.. image:: https://travis-ci.org/gnuworldman/pyneric.svg?branch=master\n :alt: Build Status\n :target: https://travis-ci.org/gnuworldman/pyneric\n\n.. image:: https://img.shields.io/coveralls/gnuworldman/pyneric.svg\n :alt: Coverage Status\n :target: https://coveralls.io/r/gnuworldman/pyneric?branch=master\n\nOverview\n========\n\nThis library is intended as a place for Python code whose scope is generic, not\nspecific to any particular business domain. The pyneric.future package is\nintended to include everything needed to easily support Python 2.7 and 3.3+\nsimultaneously using the Python-Future library.\n\nExamples\n========\n\nImporting\n---------\n\n>>> import pyneric\n\nSupporting recent versions Python 2 and 3 simultaneously\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe `future` package does a great job of allowing one to support Python 2.6,\n2.7, and 3.3+ with the same code base; however, some modifications that exist\nin the `pyneric.future` package can help ease or fix a few shortcomings. One\ncan use the following to import common 2/3 compatibility features::\n\n from __future__ import absolute_import, division, print_function, unicode_literals\n from pyneric.future import *\n\nPython identifier transformation\n--------------------------------\n\nlower/underscore to titled-terms (pascalize function)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n>>> pyneric.pascalize('basic_python_identifier')\n'BasicPythonIdentifier'\n\ntitled-terms to lower/underscore (underscore function)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n>>> pyneric.underscore('BasicPythonIdentifier')\n'basic_python_identifier'\n\nGet a function name from the stack\n----------------------------------\n\nthe current function name\n^^^^^^^^^^^^^^^^^^^^^^^^^\n>>> def foo():\n... return pyneric.get_function_name()\n...\n>>> foo()\n'foo'\n\nalso further back in the stack\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>> def foo():\n... def bar():\n... return pyneric.get_function_name(1) + pyneric.get_function_name()\n... return bar()\n...\n>>> foo()\n'foobar'\n\nReturn upon exception (tryf function)\n-------------------------------------\n\nno exception\n^^^^^^^^^^^^\n\n>>> pyneric.tryf(tuple, [])\n()\n\ncatch any non-system-exiting exception by default\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n>>> pyneric.tryf(tuple, object)\n\n\ncatch more specific exceptions\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>> pyneric.tryf(tuple, object, _except=TypeError)\n\n\nreturn a different value upon exception\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>> pyneric.tryf(tuple, object, _return=())\n()\n\nTest Python identifier validity\n-------------------------------\n\nreturn boolean\n^^^^^^^^^^^^^^\n\n>>> pyneric.valid_python_identifier('not_a_keyword')\nTrue\n>>> pyneric.valid_python_identifier('class')\nFalse\n>>> pyneric.valid_python_identifier('xyz.abc', dotted=True)\nTrue\n>>> pyneric.valid_python_identifier('class.keyword', dotted=True)\nFalse\n\nraise exception\n^^^^^^^^^^^^^^^\n\n>>> pyneric.valid_python_identifier('not_a_keyword', exception=True)\nTrue\n>>> pyneric.valid_python_identifier('class', exception=True)\nTraceback (most recent call last):\n ...\nValueError: 'class' is a Python keyword.\n\nraise a specific exception\n^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n>>> class MyException(Exception): pass\n\n>>> pyneric.valid_python_identifier('1nv4l1d', exception=MyException)\nTraceback (most recent call last):\n ...\nMyException: '1nv4l1d' is not a valid Python identifier.\n\nMake a request to a REST resource\n---------------------------------\n\n>>> class UserAgent(pyneric.rest_requests.RestResource): url_path = 'user-agent'\n\n>>> headers = {'User-Agent': 'Mozilla, but not really', 'Accept': 'application/json'}\n\n>>> str(UserAgent('http://httpbin.org').get(headers=headers).json()['user-agent'])\n'Mozilla, but not really'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gnuworldman/pyneric", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pyneric", "package_url": "https://pypi.org/project/pyneric/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyneric/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/gnuworldman/pyneric" }, "release_url": "https://pypi.org/project/pyneric/1.3.0/", "requires_dist": null, "requires_python": null, "summary": "generic Python library", "version": "1.3.0" }, "last_serial": 1700878, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "81929e2626f7090fa7362d7aac39e444", "sha256": "c3edaad2898750cb79968f61e1fd7e93b65863b05d960d5e4021581f56f0667b" }, "downloads": -1, "filename": "pyneric-0.1.0.tar.gz", "has_sig": false, "md5_digest": "81929e2626f7090fa7362d7aac39e444", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6339, "upload_time": "2014-10-13T12:43:46", "url": "https://files.pythonhosted.org/packages/c3/0b/af891186ea26618302a96ea325a3e433b7017f83dac696e3f216a8f155b0/pyneric-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7c51fbd25be3f2f4b81bb3bf500f0155", "sha256": "c5523c54e2b4612451c3722310c12ce831a2a456169fdb0a77bd2d9112b161d7" }, "downloads": -1, "filename": "pyneric-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7c51fbd25be3f2f4b81bb3bf500f0155", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7023, "upload_time": "2014-10-23T12:28:43", "url": "https://files.pythonhosted.org/packages/3a/62/b3f0568178117c8f68dc31d4bb03a8413e3fe6facb6eaddc7bcd61a7e4dc/pyneric-0.2.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "d41f874282eb6194366b40be54893aff", "sha256": "fb553fdc45e1a96ab9c8a3e02f0f8fe54f9e181d846aa0b3af936ce0f8fbe32a" }, "downloads": -1, "filename": "pyneric-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d41f874282eb6194366b40be54893aff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16271, "upload_time": "2015-01-04T23:02:51", "url": "https://files.pythonhosted.org/packages/3c/23/11be1c719e7df0393188a37eecef225aaf2c5b936a61790aed0f22092b16/pyneric-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "cb1d14118b38e0b6a1aedc66dc168758", "sha256": "59db053316e9ed35664f0def18213a2c6b97f44f98ba846db1aafcee6b4c3fcd" }, "downloads": -1, "filename": "pyneric-1.1.0.tar.gz", "has_sig": false, "md5_digest": "cb1d14118b38e0b6a1aedc66dc168758", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16902, "upload_time": "2015-02-22T13:42:32", "url": "https://files.pythonhosted.org/packages/41/bb/dc481238cb8e1785698464ec43740d7d5c43f381683aa1a1350f3c49c2df/pyneric-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ed53cfd8f9fe183053ea72475c8e3f5a", "sha256": "eacadd53c08407897723e44f4a5858497de15a81032d44cb6abb5d09468303be" }, "downloads": -1, "filename": "pyneric-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ed53cfd8f9fe183053ea72475c8e3f5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16934, "upload_time": "2015-02-22T15:20:31", "url": "https://files.pythonhosted.org/packages/99/27/7440ccdfafd4e195e1ae9392e996f5dbfeb26554e6f42f8673fb653f7846/pyneric-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "a1df00e228f88970f2e3eee1a9bb5cc7", "sha256": "54730773e230e2844fc3fa175c591de8a5babc2143bee1ef3ad2693bcc8a3d87" }, "downloads": -1, "filename": "pyneric-1.2.0.tar.gz", "has_sig": false, "md5_digest": "a1df00e228f88970f2e3eee1a9bb5cc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17732, "upload_time": "2015-03-09T01:08:56", "url": "https://files.pythonhosted.org/packages/27/20/98a8ce732cf4985639777272e9a624fc5bbb4f32b23ea596f7ca8ed29027/pyneric-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "08ac81a9746cc2fab565251062105996", "sha256": "ea002abbcb1c1aa1c8c3660b64c923af829f0a7c556e37d8cd286fd7d7eb16b5" }, "downloads": -1, "filename": "pyneric-1.2.1.tar.gz", "has_sig": false, "md5_digest": "08ac81a9746cc2fab565251062105996", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17991, "upload_time": "2015-03-22T21:06:53", "url": "https://files.pythonhosted.org/packages/23/7d/9eb2ecd85b4d0e5a849a87d69925f967e9f9acf6d42ebafc5df17b6e7b37/pyneric-1.2.1.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "886ff07bbf78ee3edc265a2e28cd0cb8", "sha256": "7422f05cae8e345d63776b22324bb0302d034952773546cd885cb8eca2bfb594" }, "downloads": -1, "filename": "pyneric-1.3.0.tar.gz", "has_sig": false, "md5_digest": "886ff07bbf78ee3edc265a2e28cd0cb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21357, "upload_time": "2015-08-31T00:37:06", "url": "https://files.pythonhosted.org/packages/44/c5/b9d7b4d7ff7c8d6875ed02d2269f3887294183639b219eafacce55fa61a9/pyneric-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "886ff07bbf78ee3edc265a2e28cd0cb8", "sha256": "7422f05cae8e345d63776b22324bb0302d034952773546cd885cb8eca2bfb594" }, "downloads": -1, "filename": "pyneric-1.3.0.tar.gz", "has_sig": false, "md5_digest": "886ff07bbf78ee3edc265a2e28cd0cb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21357, "upload_time": "2015-08-31T00:37:06", "url": "https://files.pythonhosted.org/packages/44/c5/b9d7b4d7ff7c8d6875ed02d2269f3887294183639b219eafacce55fa61a9/pyneric-1.3.0.tar.gz" } ] }