{ "info": { "author": "BennyThink", "author_email": "benny@bennythink.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\npyweathercn:\n============\n.. image:: https://travis-ci.org/BennyThink/pyweathercn.svg?branch=master\n :target: https://travis-ci.org/BennyThink/pyweathercn\n.. image:: https://badge.fury.io/py/pyweathercn.svg\n :target: https://badge.fury.io/py/pyweathercn\n\nAn weather forecast library from www.weather.com.cn\n\nInstallation\n------------\n\nTo install this package, simply use pip: ``$ pip3 install pyweathercn``.\n\nThere's no plan to support Python 2.\n\nExample\n--------\n\nPython Console example:\n******************************\n\n.. code:: python\n\n >>> import pyweathercn\n >>> pyweathercn.Weather('\u91cd\u5e86').temp()\n '\u91cd\u5e86\uff1a20'\n >>> w = pyweathercn.Weather('\u5317\u4eac')\n >>> w.data\n {'city': '\u5317\u4eac', 'aqi': '73', 'tip': '\u7d2b\u5916\u7ebf\u6307\u6570\u4e2d\u7b49\u6d82\u64e6SPF\u5927\u4e8e15\u3001PA+\u9632\u6652\u62a4\u80a4\u54c1\u3002\u7a7f\u8863\u6307\u6570\u8f83\u8212\u9002\u5efa\u8bae\u7a7f\u8584\u5916\u5957\u6216\u725b\u4ed4\u88e4\u7b49\u670d\u88c5\u3002', 'temp': '11', 'forecast': [{'date': '17\u65e5\uff08\u4eca\u5929\uff09', 'type': '\u6674', 'temp': '4\u2103', 'wind': '\u65e0\u6301\u7eed\u98ce\u5411 <3\u7ea7'}, {'date': '18\u65e5\uff08\u660e\u5929\uff09', 'type': '\u6674', 'temp': '18\u2103/5\u2103', 'wind': '\u5357\u98ce <3\u7ea7'}, {'date': '19\u65e5\uff08\u540e\u5929\uff09', 'type': '\u591a\u4e91', 'temp': '18\u2103/6\u2103', 'wind': '\u897f\u5357\u98ce <3\u7ea7'}, {'date': '20\u65e5\uff08\u5468\u516d\uff09', 'type': '\u591a\u4e91', 'temp': '18\u2103/7\u2103', 'wind': '\u5357\u98ce <3\u7ea7'}, {'date': '21\u65e5\uff08\u5468\u65e5\uff09', 'type': '\u591a\u4e91', 'temp': '18\u2103/8\u2103', 'wind': '\u5357\u98ce <3\u7ea7'}, {'date': '22\u65e5\uff08\u5468\u4e00\uff09', 'type': '\u591a\u4e91\u8f6c\u6674', 'temp': '19\u2103/7\u2103', 'wind': '\u5357\u98ce <3\u7ea7'}, {'date': '23\u65e5\uff08\u5468\u4e8c\uff09', 'type': '\u6674', 'temp': '19\u2103/5\u2103', 'wind': '\u897f\u98ce <3\u7ea7'}]}\n >>> w.today()\n '\u5317\u4eac\uff1a23\u65e5\uff08\u4eca\u5929\uff09\u667415\u2103\u897f\u5357\u98ce 3-4\u7ea7'\n >>> w.tomorrow(True)\n {'date': '24\u65e5\uff08\u660e\u5929\uff09', 'type': '\u6674', 'temp': '31\u2103/17\u2103', 'wind': '\u5357\u98ce 3-4\u7ea7'}\n >>> w.tip()\n '\u5317\u4eac\u6e29\u99a8\u63d0\u793a\uff1a\u7d2b\u5916\u7ebf\u6307\u6570\u5f88\u5f3a\u6d82\u64e6SPF20\u4ee5\u4e0a\uff0cPA++\u62a4\u80a4\u54c1\uff0c\u907f\u5f3a\u5149\u3002\u7a7f\u8863\u6307\u6570\u70ed\u9002\u5408\u7a7fT\u6064\u3001\u77ed\u8584\u5916\u5957\u7b49\u590f\u5b63\u670d\u88c5\u3002'\n >>> w.forecast(False,5)\n '\u5317\u4eac\uff1a28\u65e5\uff08\u5468\u4e00\uff09\u591a\u4e9125\u2103/15\u2103\u4e1c\u5317\u98ce <3\u7ea7'\n\nRun as a server:\n******************************\nIn order for better performance, please install Redis.\n\n.. code:: python\n\n import pyweathercn\n # running on http://127.0.0.1:8888\n pyweathercn.server(host='127.0.0.1')\n # running on http://0.0.0.0:3333\n pyweathercn.server(3333)\n # support ssl: https://www.example.com:8888\n # if you fail to listen on www.example.com, you may try 0.0.0.0 instead.\n pyweathercn.server('8888', 'www.example.com', ssl_options={\n \"certfile\": \"fullchain.pem\",\n \"keyfile\": \"privkey.pem\"})\n\nTo access REST API, you may try GET parameter, POST form-data/url-encoded form-data and POST JSON.\n\nMandatory parameter is city, optional parameter is day.\n\nGET: ``http://127.0.0.1:8888/weather?city=\u4e0a\u6d77&day=2``\n\nPOST:``http://127.0.0.1:8888/weather`` with form/json key-value:{\"city\",\"\u6df1\u5733\"}\n\n\nRun as a server(with API authentication):\n*********************************************\n\n.. code:: python\n\n import pyweathercn\n # running on http://0.0.0.0:3333\n pyweathercn.server(auth='/path/to/database.sqlite')\n\nPlease refer to ``sample.sqlite`` for database format. In this sample:\n\n* times: total times for access this API\n* restrict: set to 0 avoid time limit\n* key: no more than 32 characters.\n\nYou only need to add a parameter called ``key`` for your request.\n\nAbout cURL\n----------\nIf you're using cURL on Windows(such as ``git bash``, ``MinGW``), you may receive an HTTP 400.\n\nThis is because cURL will try to encode query parameters by GBK instead of UTF-8.\nThis might be an implementation bug on Windows, I'm looking on it.\n\nFor now the best thing you should do is use url-encode for all your city name.\n\nTODO\n-----\n- add server deployment: systemd and docker\n- cURL compatibility\n\nDesign\n-------\n`RESETful API Specification `_\n\nLicense\n-------\nMIT\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/BennyThink/pyweathercn", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyweathercn", "package_url": "https://pypi.org/project/pyweathercn/", "platform": "", "project_url": "https://pypi.org/project/pyweathercn/", "project_urls": { "Homepage": "https://github.com/BennyThink/pyweathercn" }, "release_url": "https://pypi.org/project/pyweathercn/1.0.7/", "requires_dist": null, "requires_python": "", "summary": "A package to use weather.com.cn forecast", "version": "1.0.7" }, "last_serial": 5628417, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "de3ee0dba171672ad260dbd51a2e2b5d", "sha256": "48a9a372faac3456d2c5711bbfe3b6a304ac4fb516c4dfe6035e94eae433e742" }, "downloads": -1, "filename": "pyweathercn-0.1.0.tar.gz", "has_sig": false, "md5_digest": "de3ee0dba171672ad260dbd51a2e2b5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26508, "upload_time": "2018-05-25T14:44:27", "url": "https://files.pythonhosted.org/packages/df/4c/f42bfdc21ea6db6019039bed62c4a0aa5276d4a1c0e68e9c5fa2f4c83c27/pyweathercn-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "9a9c7cad6a456d9dc5d4360444a4ea97", "sha256": "a9fa7703989b8f21600f8a55f1e5e5f8d3920f2b8783cc3a0580735961814daf" }, "downloads": -1, "filename": "pyweathercn-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9a9c7cad6a456d9dc5d4360444a4ea97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27237, "upload_time": "2018-05-25T15:09:44", "url": "https://files.pythonhosted.org/packages/bc/a6/824786d97f7d43febaecc122ba4a07abe11645d4f7a105eb39ed0dd2050e/pyweathercn-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "f6d0cefd94ee697e2ea65d8e80e941e2", "sha256": "9bad55eb598bfd90a408fe96d276eb2355c0d101894e1fcf4fc2348d17041d56" }, "downloads": -1, "filename": "pyweathercn-0.1.10.tar.gz", "has_sig": false, "md5_digest": "f6d0cefd94ee697e2ea65d8e80e941e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29918, "upload_time": "2018-10-14T12:51:42", "url": "https://files.pythonhosted.org/packages/eb/5e/5b2aab2aa8b2ff1c3d6635129e8f6dbbf3ddb064a243f0639c12644cba2a/pyweathercn-0.1.10.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "cfce17280cbcd139ecc6633ad9c44dd9", "sha256": "c753ae5171039b5cbea3fd38b45c0af3d1d1d795a973361e33fbd3126bf4a51e" }, "downloads": -1, "filename": "pyweathercn-0.1.2.tar.gz", "has_sig": false, "md5_digest": "cfce17280cbcd139ecc6633ad9c44dd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27893, "upload_time": "2018-08-18T07:40:59", "url": "https://files.pythonhosted.org/packages/c0/cd/e5242b05f0677efb8429440e75eb3a31c5150574836b2fa63014858f6191/pyweathercn-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "cdad3c734c1f5f10c5b4a6d3d467cc7a", "sha256": "b21ff8c17687351f7822bd318b6993f2bf15a1a46f5566b557d59127049f36b4" }, "downloads": -1, "filename": "pyweathercn-0.1.3.tar.gz", "has_sig": false, "md5_digest": "cdad3c734c1f5f10c5b4a6d3d467cc7a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27893, "upload_time": "2018-08-18T08:26:43", "url": "https://files.pythonhosted.org/packages/c9/3b/b8c6923c679da2f0eec9205530f67955698f0270d5910eb49eef5aba54e7/pyweathercn-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "1504b9ccdb1d7fd26114c7e77df80a91", "sha256": "8c8fca4975b85fed16aae4e89f5ed188573d6d3c02822e7065acd7ff62d3f797" }, "downloads": -1, "filename": "pyweathercn-0.1.4.tar.gz", "has_sig": false, "md5_digest": "1504b9ccdb1d7fd26114c7e77df80a91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29064, "upload_time": "2018-08-19T07:43:45", "url": "https://files.pythonhosted.org/packages/d2/b4/cf1518f0f1fc607396b3e8bdf31e3f2724a1e890b17d41ba46a28c42ee55/pyweathercn-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c57a7755361377aae79b96615c221036", "sha256": "28faa2a79923231c067a8ee90c30dccc06aa16f675bfc462fc4255425e21d854" }, "downloads": -1, "filename": "pyweathercn-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c57a7755361377aae79b96615c221036", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29766, "upload_time": "2018-09-27T12:56:24", "url": "https://files.pythonhosted.org/packages/96/83/4bf09bc68a034742e1d927432106664c33018c5fa8d195bde485abeb24e0/pyweathercn-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "56b6b84c2348d62c93e5ae2b38203f9a", "sha256": "04090669bc78fa168ff65dc5223e97f67efd04718249235d704a2d04c62377df" }, "downloads": -1, "filename": "pyweathercn-0.1.6.tar.gz", "has_sig": false, "md5_digest": "56b6b84c2348d62c93e5ae2b38203f9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29781, "upload_time": "2018-09-27T13:18:31", "url": "https://files.pythonhosted.org/packages/09/a0/b9f82adb43b756e3031017c13f6402d8572ab97261d602f98329c75c7322/pyweathercn-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "697991d370d03f50ab80887cfe89214e", "sha256": "87962a539a6d3101e6ac13087b2b3e597aa925cf51a065115c5077ad70fd5f79" }, "downloads": -1, "filename": "pyweathercn-0.1.7.tar.gz", "has_sig": false, "md5_digest": "697991d370d03f50ab80887cfe89214e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29891, "upload_time": "2018-10-06T06:55:55", "url": "https://files.pythonhosted.org/packages/49/e6/856349d8261678e0ec4e4f0e96e5180708fa7e8afa06df1a64592955f1ea/pyweathercn-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "d48575ce2fdfbf07dd696947a235e45b", "sha256": "8a97651a7b3134dd93e4e32234a4af03592df88d8bf5f85481346763486a2672" }, "downloads": -1, "filename": "pyweathercn-0.1.8.tar.gz", "has_sig": false, "md5_digest": "d48575ce2fdfbf07dd696947a235e45b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29886, "upload_time": "2018-10-08T10:54:37", "url": "https://files.pythonhosted.org/packages/a5/d9/b6041547755d678f8bcbd38f1bf5c7269c2b40479008a04d70ba2941cd68/pyweathercn-0.1.8.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "c2268b8d590a15376feffff4da68845b", "sha256": "bd7ae36d6c6d88ad755b961f3e14592375baf9d126176d953cc45c8133d25d99" }, "downloads": -1, "filename": "pyweathercn-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c2268b8d590a15376feffff4da68845b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30028, "upload_time": "2018-10-17T12:48:53", "url": "https://files.pythonhosted.org/packages/bd/eb/617e1a1c2d50c736348b215a5b6b46270358ce0f572f49b5aff7bc7adde0/pyweathercn-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "0c865039f881ddba15605c0273bc2d4b", "sha256": "284a995fefc90fc83ce3324c8010f77571233594e302ee8f7d67acb58eae7cf1" }, "downloads": -1, "filename": "pyweathercn-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0c865039f881ddba15605c0273bc2d4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31378, "upload_time": "2019-01-14T01:03:14", "url": "https://files.pythonhosted.org/packages/17/27/a4bc35904702d69c3cbe5dde1266ce43bbdd1b65eaab7d5a8c5d1199c472/pyweathercn-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "2f917045492af4c8a565274878ad3aa0", "sha256": "eb93af36d33e197e75dff629fead9a289b5e5afb4de98d21498bab503a453e1f" }, "downloads": -1, "filename": "pyweathercn-1.0.3.tar.gz", "has_sig": false, "md5_digest": "2f917045492af4c8a565274878ad3aa0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30342, "upload_time": "2019-01-20T05:02:52", "url": "https://files.pythonhosted.org/packages/5b/e5/4d13dac1b1f4691a473c5846896bed45b87b74e255d6b7886108d8c65618/pyweathercn-1.0.3.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "7246e8378c731c1d10899dd4223c6aec", "sha256": "d2ea123db67891008108d4b1b80b0d956737a83a0ac1d15ae8661fcb1d0fa410" }, "downloads": -1, "filename": "pyweathercn-1.0.5.tar.gz", "has_sig": false, "md5_digest": "7246e8378c731c1d10899dd4223c6aec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32143, "upload_time": "2019-03-25T13:35:32", "url": "https://files.pythonhosted.org/packages/b7/45/cf1e126eefdfbb37d231676e604b0e624445b6ff063ef9f2890106af7b88/pyweathercn-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "e29bc379dc0b171eccae9ffa3f5a338a", "sha256": "9b8249686dc72ff31c8695e62669d7515b344e5958bd0c798105788ca394be1c" }, "downloads": -1, "filename": "pyweathercn-1.0.6.tar.gz", "has_sig": false, "md5_digest": "e29bc379dc0b171eccae9ffa3f5a338a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31130, "upload_time": "2019-06-07T13:06:16", "url": "https://files.pythonhosted.org/packages/65/1d/3a1903307b71f4fdd6e4f7d475b96169c9ed79ee98149497d5f516ad598b/pyweathercn-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "14efe9e0f685af80f0e8b92bb249e0be", "sha256": "98110a293316e97549685da85ab152305aeefb8aa226177e8e4ca90378da34e6" }, "downloads": -1, "filename": "pyweathercn-1.0.7.tar.gz", "has_sig": false, "md5_digest": "14efe9e0f685af80f0e8b92bb249e0be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31120, "upload_time": "2019-08-03T15:02:27", "url": "https://files.pythonhosted.org/packages/a6/e3/2c7089a856359d8eca5bb5cf6fc258998e55d020244b6db528106e8bac2e/pyweathercn-1.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "14efe9e0f685af80f0e8b92bb249e0be", "sha256": "98110a293316e97549685da85ab152305aeefb8aa226177e8e4ca90378da34e6" }, "downloads": -1, "filename": "pyweathercn-1.0.7.tar.gz", "has_sig": false, "md5_digest": "14efe9e0f685af80f0e8b92bb249e0be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31120, "upload_time": "2019-08-03T15:02:27", "url": "https://files.pythonhosted.org/packages/a6/e3/2c7089a856359d8eca5bb5cf6fc258998e55d020244b6db528106e8bac2e/pyweathercn-1.0.7.tar.gz" } ] }