{ "info": { "author": "Jonathan Chun", "author_email": "git@jonathanchun.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# allcities\n> a Python library to work with all the cities of the world with a population of at least 1000 inhabitants.\n\n## Note\nThis library was whipped up in an afternoon when I got a little carried away when I really needed something much simpler. It is not fully tested and will need revisiting/cleanup.\n\n## Installation\n```sh\npip install allcities\n```\n\n## Usage example\nUsage of this library is quite simple.\n```python\nfrom allcities import cities\n\nresults = cities.filter(name='Los Angeles')\nfor result in results:\n print(result)\n```\n`cities` is a set-like object that contains objects that represent cities. The above code will output:\n```\n\n\n\n\n\n\n\n```\nYou can chain/combine filters as follows:\n```python\nresults = cities.filter(name='Los Angeles').filter(country_code='US')\nresults2 = cities.filter(name='Los Angeles', country_code='US')\nprint(results == results2)\nfor result in results:\n print(result)\n```\ngives you\n```\nTrue\n\n\n\n```\n\nYou can also filter on numeric properties. The syntax to do so is a comparison operator `<, <=, ==, !=, >=, >` followed by a numeric value.\n```python\nresults = cities.filter(elevation='>1000')\nresults2 = cities.filter(elevation='>1000').filter(elevation='<1500')\nprint(results)\nprint(results2)\n```\nGives you\n```\n\n\n```\nEach city object has properties that can be accessed normally or filtered on. You can also export a dictionary with the `.dict` property.\n```python\npprint.pprint(city_object.dict)\n```\nHere is the resulting dict\n```python\n{'admin1_code': 'CA',\n 'admin2_code': '037',\n 'alternatenames': ['East Los Angeles',\n 'Este de Los Angeles',\n 'Este de Los \u00c1ngeles',\n 'Ist Los Andzeles',\n 'Orienta Losangeleso',\n 'Orienta Losan\u011deleso',\n 'dong luo shan ji',\n 'iseuteuloseuaenjelleseu',\n 'ista lasa enjelsa',\n 'isutorosanzerusu',\n '\u0418\u0441\u0442 \u041b\u043e\u0441 \u0410\u043d\u045f\u0435\u043b\u0435\u0441',\n '\u0907\u0938\u094d\u091f \u0932\u0938 \u090f\u0928\u094d\u091c\u0947\u0932\u094d\u0938',\n '\u30a4\u30fc\u30b9\u30c8\u30ed\u30b5\u30f3\u30bc\u30eb\u30b9',\n '\u4e1c\u6d1b\u6749\u77f6',\n '\uc774\uc2a4\ud2b8\ub85c\uc2a4\uc564\uc824\ub808\uc2a4'],\n 'asciiname': 'East Los Angeles',\n 'country_code': 'US',\n 'dem': 63,\n 'elevation': 61,\n 'feature_class': 'P',\n 'feature_code': 'PPL',\n 'geonameid': 5344994,\n 'latitude': 34.0239,\n 'longitude': -118.17202,\n 'modification_date': '2011-05-14',\n 'name': 'East Los Angeles',\n 'population': 126496,\n 'timezone': 'America/Los_Angeles'}\n ```\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Release History\n* 1.0.0\n * Initial Release\n\n## Contributing\n1. Fork it ()\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Jonchun/allcities", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "allcities", "package_url": "https://pypi.org/project/allcities/", "platform": "", "project_url": "https://pypi.org/project/allcities/", "project_urls": { "Homepage": "https://github.com/Jonchun/allcities" }, "release_url": "https://pypi.org/project/allcities/1.0.3/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "allcities - Python library to access all the cities of the world with a population of at least 1000 inhabitants.", "version": "1.0.3" }, "last_serial": 4892313, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "da25df4ba9feece78ad634b1fd622a12", "sha256": "4f2628c00a0ad3d61980bafe7a6b682b341bdaae2945ba6a0749a676c5108b73" }, "downloads": -1, "filename": "allcities-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "da25df4ba9feece78ad634b1fd622a12", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16473113, "upload_time": "2019-03-04T01:17:32", "url": "https://files.pythonhosted.org/packages/50/c8/7da067bc638794bf9d3c6d748d8f3f048c241f8a71a53cee92f1732f10e8/allcities-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a6aa2e543bf62983e0e7a8e72177d3b", "sha256": "76240a091bca8e2ab505247eefa23b30ae1c19f023503d228921f03841a090a6" }, "downloads": -1, "filename": "allcities-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8a6aa2e543bf62983e0e7a8e72177d3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7239, "upload_time": "2019-03-04T01:17:34", "url": "https://files.pythonhosted.org/packages/86/b7/7cca12415bc2a682e5b2cbe4dc7b16df3485c5262de14e6cada33624eeb9/allcities-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "da25df4ba9feece78ad634b1fd622a12", "sha256": "4f2628c00a0ad3d61980bafe7a6b682b341bdaae2945ba6a0749a676c5108b73" }, "downloads": -1, "filename": "allcities-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "da25df4ba9feece78ad634b1fd622a12", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16473113, "upload_time": "2019-03-04T01:17:32", "url": "https://files.pythonhosted.org/packages/50/c8/7da067bc638794bf9d3c6d748d8f3f048c241f8a71a53cee92f1732f10e8/allcities-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a6aa2e543bf62983e0e7a8e72177d3b", "sha256": "76240a091bca8e2ab505247eefa23b30ae1c19f023503d228921f03841a090a6" }, "downloads": -1, "filename": "allcities-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8a6aa2e543bf62983e0e7a8e72177d3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7239, "upload_time": "2019-03-04T01:17:34", "url": "https://files.pythonhosted.org/packages/86/b7/7cca12415bc2a682e5b2cbe4dc7b16df3485c5262de14e6cada33624eeb9/allcities-1.0.3.tar.gz" } ] }