{ "info": { "author": "Rolando Espinoza", "author_email": "rolando at rmax.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\nYet Another Murmurhash3 Binding\n===============================\n\n.. image:: https://img.shields.io/pypi/v/yammh3.svg\n :target: https://pypi.python.org/pypi/yammh3\n\n.. image:: https://img.shields.io/travis/rolando/yammh3.svg\n :target: https://travis-ci.org/rolando/yammh3\n\n.. image:: https://readthedocs.org/projects/yammh3/badge/?version=latest\n :target: https://readthedocs.org/projects/yammh3/?badge=latest\n :alt: Documentation Status\n\n\nPython/Cython Murmurhash3 binding.\n\n* Free software: MIT license\n* Documentation: https://yammh3.readthedocs.org.\n\nFeatures\n--------\n\n* Provides a high-level Python API.\n* Provides a low-level Cython binding.\n* Python 2 and 3 support.\n\nExample\n-------\n\nHere is an example in Python:\n\n.. code:: python\n\n from yammh3 import hash64\n\n key = b\"yammh3!\"\n\n # hash* functions return a signed integer by default.\n print(\"signed 64 bits hash is %s\" % hash64(key)) # -> -1339990020854215562\n print(\"unsigned 64 bits hash is %s\" % hash64(key, signed=False)) # -> 17106754052855336054L\n\n\nIn Cython, first we need to write a ``.pyx`` file with our code:\n\n.. code:: cython\n\n # file: yammh3_example.pyx\n # mhash* functions are only available via cimport.\n from yammh3._yammh3 cimport mhash64, mhash64s\n from yammh3._yammh3 cimport int64_t, uint64_t, uint32_t\n\n def print_hashes(bytes key):\n cdef uint64_t h1\n cdef int64_t h2\n cdef uint32_t n = len(key)\n cdef char *c_key = key\n\n with nogil: # releasing the GIL!\n h1 = mhash64(c_key, n)\n h2 = mhash64s(c_key, n)\n\n print(\"unsigned 64 bits hash is %d\" % h1)\n print(\"signed 64 bits hash is %d\" % h2)\n\n\nWe need to compile it as a module, usually by using a setup script:\n\n.. code:: python\n\n # file: setup.py\n from setuptools import setup\n from setuptools.extension import Extension\n from Cython.Build import cythonize\n\n import yammh3 # already installed\n\n setup(\n name='yammh3-example',\n ext_modules=cythonize([\n Extension('*', ['*.pyx'], include_dirs=[yammh3.get_include()]),\n ])\n )\n\n\nThen we build the modules in-place:\n\n.. code::\n\n $ python setup.py build_ext --inplace\n Running build_ext\n building 'yammh3_example' extension\n ... [snip] ...\n copying build/lib.macosx-10.5-x86_64-2.7/yammh3_example.so ->\n\n\nNow we are ready to run our code:\n\n.. code::\n\n $ python -c 'import yammh3_example; yammh3_example.print_hashes(b\"yammh3!\")'\n unsigned 64 bits hash is 17106754052855336054\n signed 64 bits hash is -1339990020854215562\n\n\nCredits\n---------\n\nMurmurhash3 was originally created by `Austin Appleby`_.\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`Austin Appleby`: https://github.com/aappleby/smhasher\n\n\n=======\nHistory\n=======\n\n0.1.1 (2016-06-23)\n------------------\n\n* First **usable** release :)\n\n0.1.0 (2016-06-17)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rolando/yammh3", "keywords": "yammh3", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "yammh3", "package_url": "https://pypi.org/project/yammh3/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/yammh3/", "project_urls": { "Homepage": "https://github.com/rolando/yammh3" }, "release_url": "https://pypi.org/project/yammh3/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Python/Cython Murmurhash3 binding.", "version": "0.1.2" }, "last_serial": 2184552, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f899ff3811169d96335c9afdd7d33a5a", "sha256": "45a1d208a1b413a50f948794e56c0bb30011df2d8ac777665ba984282da428a1" }, "downloads": -1, "filename": "yammh3-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f899ff3811169d96335c9afdd7d33a5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 236522, "upload_time": "2016-06-23T10:56:43", "url": "https://files.pythonhosted.org/packages/a7/ee/ed160cb363c988aa2c6671869bc4b3c0045106a8c1e8708fecde6724b3c0/yammh3-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6ed985c6fe6eb30e2a0af0e01e0d99c5", "sha256": "187ade7ee6fd0d9499bc71835e79b5e79cb4b8fce4d072ff071f67285187dd77" }, "downloads": -1, "filename": "yammh3-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6ed985c6fe6eb30e2a0af0e01e0d99c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225358, "upload_time": "2016-06-24T03:17:06", "url": "https://files.pythonhosted.org/packages/06/47/5aeeeb8739dad8ecc642c65c0b8db4f42f7ff5dd9ca50023719747c3a3e4/yammh3-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6ed985c6fe6eb30e2a0af0e01e0d99c5", "sha256": "187ade7ee6fd0d9499bc71835e79b5e79cb4b8fce4d072ff071f67285187dd77" }, "downloads": -1, "filename": "yammh3-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6ed985c6fe6eb30e2a0af0e01e0d99c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225358, "upload_time": "2016-06-24T03:17:06", "url": "https://files.pythonhosted.org/packages/06/47/5aeeeb8739dad8ecc642c65c0b8db4f42f7ff5dd9ca50023719747c3a3e4/yammh3-0.1.2.tar.gz" } ] }