{ "info": { "author": "Christopher Crouzet", "author_email": "christopher.crouzet@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "Nani\n====\n\n.. image:: https://img.shields.io/travis/christophercrouzet/nani/master.svg\n :target: https://travis-ci.org/christophercrouzet/nani\n :alt: Build status\n\n.. image:: https://img.shields.io/coveralls/christophercrouzet/nani/master.svg\n :target: https://coveralls.io/r/christophercrouzet/nani\n :alt: Coverage Status\n\n.. image:: https://img.shields.io/pypi/v/nani.svg\n :target: https://pypi.python.org/pypi/nani\n :alt: PyPI latest version\n\n.. image:: https://readthedocs.org/projects/nani/badge/?version=latest\n :target: https://nani.readthedocs.io\n :alt: Documentation status\n\n.. image:: https://img.shields.io/pypi/l/nani.svg\n :target: https://pypi.python.org/pypi/nani\n :alt: License\n\n\nNani is a Python library that provides an alternative approach to defining and\nviewing `NumPy`_'s arrays.\n\nUpon getting started with NumPy, the rules to define |numpy.dtype|_ objects\ntend to quickly become *confusing*. Not only different syntaxes can create a\nsame data type, but it also seems *arbitrary* and hence *difficult* to remember\nthat sub-array data types can only be defined as tuples while structured data\ntypes exclusively require lists made of field tuples, and so on.\n\nTo address this point, Nani takes the stance of offering one\u2014and only one\u2014way\nof constructing ``numpy.dtype`` objects. Although this syntax makes the code\nmore verbose, it also makes it easier to read and to reason about.\n\nNani's approach allows **type introspection** which brings additional benefits\nin the form of dynamically generated **default values** and **view types**.\nDefault values facilitate the definition of new array elements while view types\nare useful to encapsulate interactions with NumPy and to expose a different\npublic interface to your library users instead of the one provided with\n``numpy.ndarray``.\n\n\nFeatures\n--------\n\n* explicit syntax for defining ``numpy.dtype`` objects.\n* generates default values and view types.\n* allows for type introspection.\n\n\nUsage\n-----\n\n.. code-block:: python\n\n >>> import numpy\n >>> import nani\n >>> color_type = nani.Array(\n ... element_type=nani.Number(type=numpy.uint8, default=255),\n ... shape=3,\n ... view=None)\n >>> dtype, default, view = nani.resolve(color_type, name='Color')\n >>> a = numpy.array([default] * 2, dtype=dtype)\n >>> v = view(a)\n >>> for color in v:\n ... print(color)\n [255, 255, 255]\n [255, 255, 255]\n\n\nThe ``color_type`` above defines an array of 3 ``numpy.uint8`` elements having\neach a default value of ``255``. The resulting ``dtype`` and ``default``\nobjects are used to initialize a new NumPy array of 10 color elements, while\nthe ``view`` type is used to wrap that array into a standard collection\ninterface.\n\n\nSee the `Tutorial`_ section from the documentation for more detailed examples\nand explanations on how to use Nani.\n\n\nDocumentation\n-------------\n\nRead the documentation online at `nani.readthedocs.io`_ or check its source in\nthe ``doc`` directory.\n\n\nAuthor\n------\n\nChristopher Crouzet\n<`christophercrouzet.com `_>\n\n\n.. |numpy.dtype| replace:: ``numpy.dtype``\n\n.. _nani.readthedocs.io: https://nani.readthedocs.io\n.. _NumPy: http://www.numpy.org\n.. _numpy.dtype: https://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html\n.. _Tutorial: https://nani.readthedocs.io/en/latest/tutorial.html", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/christophercrouzet/nani", "keywords": "nani numpy dtype view wrap", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nani", "package_url": "https://pypi.org/project/nani/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nani/", "project_urls": { "Homepage": "https://github.com/christophercrouzet/nani" }, "release_url": "https://pypi.org/project/nani/0.2.0/", "requires_dist": [ "numpy", "coverage; extra == 'dev'", "sphinx (>=1.3); extra == 'dev'", "tox; extra == 'dev'", "sphinx (>=1.3); extra == 'docs'" ], "requires_python": "", "summary": "Alternative approach to defining and viewing NumPy's arrays", "version": "0.2.0" }, "last_serial": 2581496, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "068035605af73977e6a66223904ddc53", "sha256": "a97c07c82592660031ee728818429b73973069a5890da53dc11bc4c0e7f9e7ba" }, "downloads": -1, "filename": "nani-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "068035605af73977e6a66223904ddc53", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10240, "upload_time": "2016-10-24T10:52:03", "url": "https://files.pythonhosted.org/packages/56/ff/a253354c4e331de0a212b66569f2637e5892911a9f27cba7ac42d67a183c/nani-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e01a54811e38b6d410707ab3ec26e39d", "sha256": "cfe80cc29b58b2beb791d6ae0c92b450dd9e6c89a179bf279cea1e882539ca0e" }, "downloads": -1, "filename": "nani-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e01a54811e38b6d410707ab3ec26e39d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24314, "upload_time": "2016-10-24T10:52:06", "url": "https://files.pythonhosted.org/packages/95/00/8b329ebf7d1edc2ad000660d0939c1a683134a37d6f1bba717d1c11f70c0/nani-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7dbccd3269912eec78b6efc00f588eaa", "sha256": "a21b9bed0d538ab33cbcd53bfdf1f483ce8394c1b18eda6b4101bc9418b4fc48" }, "downloads": -1, "filename": "nani-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7dbccd3269912eec78b6efc00f588eaa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13212, "upload_time": "2017-01-18T06:21:51", "url": "https://files.pythonhosted.org/packages/e2/b0/07986113daee52c877ce33a5a576df593ad0b056d1bdce70a1786825a613/nani-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dcdadab784fd0289aa0dc949293a12a1", "sha256": "301d5c52c48c95fc82999560925a6f5fd2e74e91dab4b8b4d28e1c71aef0b9b9" }, "downloads": -1, "filename": "nani-0.2.0.tar.gz", "has_sig": false, "md5_digest": "dcdadab784fd0289aa0dc949293a12a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28182, "upload_time": "2017-01-18T06:21:54", "url": "https://files.pythonhosted.org/packages/55/2c/f0dcf343c4c52b9ac6e7356d6c0e3af80bd323ae516ddd415ae27f342d9b/nani-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7dbccd3269912eec78b6efc00f588eaa", "sha256": "a21b9bed0d538ab33cbcd53bfdf1f483ce8394c1b18eda6b4101bc9418b4fc48" }, "downloads": -1, "filename": "nani-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7dbccd3269912eec78b6efc00f588eaa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13212, "upload_time": "2017-01-18T06:21:51", "url": "https://files.pythonhosted.org/packages/e2/b0/07986113daee52c877ce33a5a576df593ad0b056d1bdce70a1786825a613/nani-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dcdadab784fd0289aa0dc949293a12a1", "sha256": "301d5c52c48c95fc82999560925a6f5fd2e74e91dab4b8b4d28e1c71aef0b9b9" }, "downloads": -1, "filename": "nani-0.2.0.tar.gz", "has_sig": false, "md5_digest": "dcdadab784fd0289aa0dc949293a12a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28182, "upload_time": "2017-01-18T06:21:54", "url": "https://files.pythonhosted.org/packages/55/2c/f0dcf343c4c52b9ac6e7356d6c0e3af80bd323ae516ddd415ae27f342d9b/nani-0.2.0.tar.gz" } ] }