{ "info": { "author": "Michael McCandless & Greg Bowyer", "author_email": "mail@mikemccandless.com & gbowyer@fastmail.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: C++", "Programming Language :: Python", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Text Processing :: Linguistic" ], "description": "CLD2-CFFI - Python (CFFI) Bindings for Compact Language Detector 2\n==================================================================\n\n`CFFI `_ bindings for CLD2\n\n-----\n\n|pypi| |build| |win-build| |coverage| |lint|\n\n-----\n\n\nThis package contains the CLD (Compact Language Detection) library as\nmaintained by Dick Sites (https://code.google.com/p/cld2/). The first\nfork was done at revision r161. It also contains python bindings that\nwere originally created by `Mike\nMcCandless `_.\nThe bindings have gone through several hands, with the latest changes being made\nto rework the bindings for `CFFI `_.\n\nThese bindings are identical in API to the original cld2 bindings, and as a\nresult can be used as a drop in replacement.\n\nThe LICENSE_ is the same as Chromium's LICENSE and is included in the\nLICENSE_ file for reference.\n\n==========\nInstalling\n==========\n\nShould be as simple as\n\n.. code-block:: bash\n\n $ pip install cld2-cffi\n\n-------------------\nDevelopment Version\n-------------------\n\nThe **latest development version** can be installed directly from GitHub:\n\n.. code-block:: bash\n\n $ pip install --upgrade 'git+https://github.com/GregBowyer/cld2-cffi.git'\n\n=====\nUsage\n=====\n\n.. code-block:: python\n\n import cld2\n\n isReliable, textBytesFound, details = cld2.detect(\"This is my sample text\")\n print(' reliable: %s' % (isReliable != 0))\n print(' textBytes: %s' % textBytesFound)\n print(' details: %s' % str(details))\n\n # The output looks like so:\n # reliable: True\n # textBytes: 24\n # details: (('ENGLISH', 'en', 95, 1736.0), ('Unknown', 'un', 0, 0.0), ('Unknown', 'un', 0, 0.0))\n\n=============\nDocumentation\n=============\n\nFirst, you must get your content (plain text or HTML) encoded into UTF8\nbytes. Then, detect like this:\n\n.. code-block:: python\n\n isReliable, textBytesFound, details = cld2.detect(bytes)\n\n``isReliable`` \n is True if the top language is much better than 2nd best language.\n\n``textBytesFound`` \n tells you how many actual bytes CLD analyzed (after removing HTML tags,\n collapsing areas of too-many-spaces, etc.). \n\n``details`` \n has an entry per top 3 languages that matched, that includes the percent\n confidence of the match as well as a separate normalized score.\n\nThe module exports these global constants:\n\n``cld2.ENCODINGS``\n list of the encoding names CLD recognizes (if you provide hintEncoding, it\n must be one of these names).\n\n``cld2.LANGUAGES``\n list of languages and their codes (if you provide hintLanguageCode, it must\n be one of the codes from these codes).\n\n``cld2.EXTERNAL_LANGUAGES``\n list of external languages and their codes. Note that external languages\n cannot be hinted, but may be matched if you pass\n ``includeExtendedLanguages=True`` (the default).\n\n``cld2.DETECTED_LANGUAGES``\n list of all detectable languages, as best I can determine (this was reverse\n engineered from a unit test, ie it contains a language X if that language\n was tested and passes for at least one example text).\n\n\n=======\nAuthors\n=======\n\nPlease see `AUTHORS `_.\n\n\n==============\nReporting bugs\n==============\nPlease see `BUG_REPORTS `_.\n\n\n==========\nContribute\n==========\n\nPlease see `CONTRIBUTING `_.\n\n\n=======\nLicence\n=======\n\nPlease see LICENSE_.\n\n.. _LICENSE: https://github.com/GregBowyer/cld2-cffi/blob/master/LICENSE\n\n.. |pypi| image:: https://img.shields.io/pypi/v/cld2-cffi.svg?style=flat-square&label=latest%20version\n :target: https://pypi.python.org/pypi/cld2-cffi\n :alt: Latest version released on PyPi\n\n.. |build| image:: https://img.shields.io/travis/GregBowyer/cld2-cffi/master.svg?style=flat-square&label=OSX%20Linux%20build\n :target: http://travis-ci.org/GregBowyer/cld2-cffi\n :alt: Build status \n\n.. |win-build| image:: https://img.shields.io/appveyor/ci/GregBowyer/cld2-cffi.svg?maxAge=2592000&style=flat-square&label=Windows%20Build\n :target: https://ci.appveyor.com/project/GregBowyer/cld2-cffi\n :alt: Windows Build Status::\n\n.. |coverage| image:: https://img.shields.io/codecov/c/github/GregBowyer/cld2-cffi.svg?style=flat-square\n :target: https://codecov.io/github/GregBowyer/cld2-cffi\n :alt: Coverage\n\n.. |lint| image:: https://landscape.io/github/GregBowyer/cld2-cffi/master/landscape.svg?style=flat-square\n :target: https://landscape.io/github/GregBowyer/cld2-cffi/master\n :alt: Code Health", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/GregBowyer/cld2-cffi/", "keywords": "cld2,cffi", "license": "Apache2", "maintainer": "", "maintainer_email": "", "name": "cld2-cffi", "package_url": "https://pypi.org/project/cld2-cffi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cld2-cffi/", "project_urls": { "Homepage": "http://github.com/GregBowyer/cld2-cffi/" }, "release_url": "https://pypi.org/project/cld2-cffi/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "CFFI bindings around Google Chromium's embedded compact language detection library (CLD2)", "version": "0.1.4" }, "last_serial": 2270552, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f4f8cedb822f26a5898fd26b1bb9d6d8", "sha256": "114c37802ee1cfcd7742239bd56e67ea9044686ef8bd5048c576dda90ae66fdf" }, "downloads": -1, "filename": "cld2-cffi-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f4f8cedb822f26a5898fd26b1bb9d6d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17624294, "upload_time": "2015-08-17T02:30:08", "url": "https://files.pythonhosted.org/packages/ee/23/fb38a641ae17d62e613a14c812fab18fb0451e55c2e00d070d801c4bfa81/cld2-cffi-0.1.1.tar.gz" } ], "0.1.2": [], "0.1.3": [ { "comment_text": "", "digests": { "md5": "f988ced8e21f6a12e5e8739de57ca7b0", "sha256": "3b3ff5cfe139dba16ceccf6165cc6d490bc8481300f9a46242aeed6744686f71" }, "downloads": -1, "filename": "cld2-cffi-0.1.3.tar.gz", "has_sig": false, "md5_digest": "f988ced8e21f6a12e5e8739de57ca7b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17624415, "upload_time": "2016-07-28T19:58:16", "url": "https://files.pythonhosted.org/packages/89/6d/50a225dc340d5084136d1efeee799c5f36833e99b3498f2717bce505c616/cld2-cffi-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3c2701b856b0ac23b5f4ac9a81db99c9", "sha256": "3a29948364ed1e426c5bf542832eee208b1c70c0ad512b1a99bec0e6486f6c67" }, "downloads": -1, "filename": "cld2-cffi-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3c2701b856b0ac23b5f4ac9a81db99c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17624900, "upload_time": "2016-08-09T04:39:26", "url": "https://files.pythonhosted.org/packages/52/6d/044789e730141bcda2a7368836f714684a7d13bd44a2a33b387cb31b4335/cld2-cffi-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3c2701b856b0ac23b5f4ac9a81db99c9", "sha256": "3a29948364ed1e426c5bf542832eee208b1c70c0ad512b1a99bec0e6486f6c67" }, "downloads": -1, "filename": "cld2-cffi-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3c2701b856b0ac23b5f4ac9a81db99c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17624900, "upload_time": "2016-08-09T04:39:26", "url": "https://files.pythonhosted.org/packages/52/6d/044789e730141bcda2a7368836f714684a7d13bd44a2a33b387cb31b4335/cld2-cffi-0.1.4.tar.gz" } ] }