{ "info": { "author": "Santiago Larrain", "author_email": "santiagolarrain@gmail.com", "bugtrack_url": null, "classifiers": [], "description": ".. image:: https://travis-ci.org/slarrain/clcomuna.svg?branch=master\n :target: https://travis-ci.org/slarrain/clcomuna\n\n.. image:: https://img.shields.io/badge/pypy-1.1.3-blue.svg\n :target: https://pypi.python.org/pypi/clcomuna\n\nclcomuna\n========\n\nVery simple package that, given the name of a comuna\nfrom Chile, returns its code\n\nDescription\n-----------\nEach *comuna* in Chile has a unique code that makes easier to map them to\ndifferent attributes (e.g. choropleth). Since I was going through the hassle\nof doing it each time I had a new project, I decided to build a very simple\ntool that could automate the task. I hope this can be of use to other\ndevelopers / civic-hackers.\n\nI added a fuzzy version for cases where there was no exact match.\n\nFeatures\n--------\n- Given a comuna name, it returns its code, taking care of special characters, uppercases and lowercases.\n- If it doesn't find an exact match, it prints that and returns None\n- A fuzzy function returns the best match (uses fuzzywuzzy)\n- You can specify to print the score of the fuzzy match\n- You can specify a threshold above which it should return a match and below which it shouldn't.\n- There is a function that tries the exact match and if it doesn't find it, it goes to the fuzzy version.\n- The list of comunas-code is a simple CSV file for easier edition.\n- If you want some comuna name version added to the csv file, just contact me and I'll add them right away.\n\nInstallation\n------------\n::\n\n pip3 install clcomuna\n\nRequirements\n------------\n\n- fuzzywuzzy\n- Python3.3+\n\n\n\nUsage:\n------\n\n>>> import clcomuna\n\n(If there is a warning, ignore it. It comes with the dependency)\n\n**get_code**\n\n>>> clcomuna.get_code(\"peumo\")\n'06112'\n\n**get_fuzzy**: returns name, not code\n\n>>> clcomuna.get_fuzzy(\"alragobo\")\n'ALGARROBO'\n>>> clcomuna.get_fuzzy(\"alragobo\", True)\n('ALGARROBO', 71)\n'ALGARROBO'\n>>> clcomuna.get_fuzzy(\"alragobo\", True, 72)\n('ALGARROBO', 71)\nScore lower than minimum threshold for comuna: ALRAGOBO - ALGARROBO\n\nThe optional second parameter *True* prints the found comuna and the score.\nThe optional third parameter *int* stablishes a threshold for the function to\nreturn the best name match\n\n**get_steps**\n\n>>> clcomuna.get_steps(\"alragobo\")\nCould not find code for: ALRAGOBO\n'ALGARROBO'\n>>> clcomuna.get_steps(\"alragobo\", False, 74)\nScore lower than minimum threshold for comuna: ALRAGOBO - ALGARROBO\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/slarrain/clcomuna", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "clcomuna", "package_url": "https://pypi.org/project/clcomuna/", "platform": "", "project_url": "https://pypi.org/project/clcomuna/", "project_urls": { "Homepage": "http://github.com/slarrain/clcomuna" }, "release_url": "https://pypi.org/project/clcomuna/1.1.3/", "requires_dist": null, "requires_python": "", "summary": "Given the name of a comuna in Chile, it returns its code", "version": "1.1.3" }, "last_serial": 2998303, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "8835fe8032224d99629a68b84e6b0fc2", "sha256": "6bc7a9bcfd7fa0906f79228d73fb31ad07f79037ed789f3e8c3177efa4ac15ae" }, "downloads": -1, "filename": "clcomuna-0.3.tar.gz", "has_sig": false, "md5_digest": "8835fe8032224d99629a68b84e6b0fc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5228, "upload_time": "2016-07-26T21:35:48", "url": "https://files.pythonhosted.org/packages/3d/23/e355ffb370e754e3b8b665ffaf78e7f889e5725b26c81d0abaea8db81c72/clcomuna-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "608ddc2b03bd2abe3d373493d8d00cca", "sha256": "d4d134898c47bee727f9512d6ffa9ffcad221570ed538ff51bfd4a0739a8dd89" }, "downloads": -1, "filename": "clcomuna-0.3.1.tar.gz", "has_sig": false, "md5_digest": "608ddc2b03bd2abe3d373493d8d00cca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5217, "upload_time": "2016-07-26T21:44:40", "url": "https://files.pythonhosted.org/packages/98/7e/4c5de5a05c774a657d5cc061be3838c48443d240922a7b8e20fd2736df87/clcomuna-0.3.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "46cde39c72d59cb80b20913c393e5ae3", "sha256": "590f1283809a4ebb5382f42d045541016c91d1d59d15b47efe91b594251b0c01" }, "downloads": -1, "filename": "clcomuna-1.0.tar.gz", "has_sig": false, "md5_digest": "46cde39c72d59cb80b20913c393e5ae3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6043, "upload_time": "2016-07-27T00:53:15", "url": "https://files.pythonhosted.org/packages/3f/7d/a48be7feb006191f4830d455454b013f300a96912cc4ece6542ce03fa93d/clcomuna-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "8ac9526a452235c9ff37f9826126de1a", "sha256": "0145f2003a348184fa7288c17029296e8419bc0a7910b0b0f2cf4924a6fbd405" }, "downloads": -1, "filename": "clcomuna-1.1.tar.gz", "has_sig": false, "md5_digest": "8ac9526a452235c9ff37f9826126de1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6212, "upload_time": "2017-07-04T01:57:36", "url": "https://files.pythonhosted.org/packages/53/96/769a7f33051b8dfb869933cf5ca7b2f87b21296d2c8ad6ca6f84f09a7697/clcomuna-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "c195e89f7a8bbee41ac84714dc673160", "sha256": "f12f705e125b2de4ba8644cc065dedad6bede7af85e5b124256af76fa3db9998" }, "downloads": -1, "filename": "clcomuna-1.1.1.tar.gz", "has_sig": false, "md5_digest": "c195e89f7a8bbee41ac84714dc673160", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6236, "upload_time": "2017-07-04T02:16:35", "url": "https://files.pythonhosted.org/packages/da/2d/35e88ecbaa8cdc608bf5a6466423a3eb67ff28b6e9e107065f78938fb027/clcomuna-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "985b2c4325c3875cc4b58c0df3f6a880", "sha256": "e2b51fe42412edca62938f913a4a950c617b06a45bc4345d31e3694151a26306" }, "downloads": -1, "filename": "clcomuna-1.1.2.tar.gz", "has_sig": false, "md5_digest": "985b2c4325c3875cc4b58c0df3f6a880", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6507, "upload_time": "2017-07-04T02:24:08", "url": "https://files.pythonhosted.org/packages/7d/6f/b1bcc1ff4c2e4fd6bbe7b07f3fa9b965519db6ae65e171d462b51cdbc850/clcomuna-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "2d7fa2e853e34ddf7060b12f494ed5be", "sha256": "76fb24135fae55ad7c9168b8e9f490c394bda2bbb4060f5c7b35009c2af0b70a" }, "downloads": -1, "filename": "clcomuna-1.1.3.tar.gz", "has_sig": false, "md5_digest": "2d7fa2e853e34ddf7060b12f494ed5be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6488, "upload_time": "2017-07-04T04:07:00", "url": "https://files.pythonhosted.org/packages/4f/77/2bf5eb36096bc1dc970184807cf262a39579fdb1ed16c96d6e3f7609df21/clcomuna-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d7fa2e853e34ddf7060b12f494ed5be", "sha256": "76fb24135fae55ad7c9168b8e9f490c394bda2bbb4060f5c7b35009c2af0b70a" }, "downloads": -1, "filename": "clcomuna-1.1.3.tar.gz", "has_sig": false, "md5_digest": "2d7fa2e853e34ddf7060b12f494ed5be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6488, "upload_time": "2017-07-04T04:07:00", "url": "https://files.pythonhosted.org/packages/4f/77/2bf5eb36096bc1dc970184807cf262a39579fdb1ed16c96d6e3f7609df21/clcomuna-1.1.3.tar.gz" } ] }