{ "info": { "author": "aohan237", "author_email": "aohan237@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "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", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Distributed Computing" ], "description": "# Cache-Client\n\n[![Downloads](https://pepy.tech/badge/cache-client)](https://pepy.tech/project/cache-client)\n\n## Cache-Client\n\nmost of the time, you need cache to some kind of backend to speed up your app.\n\nthis framework add these tools to free you from write these.\n\nit also has auto update function to free you from manually update something.\n\n\n## Usage\n\n```python\nfrom logging import StreamHandler\nimport asyncio\nimport time\nfrom cache_client.client.common import SimpleClient\nimport logging\nlogger = logging.getLogger(__package__)\nhandler = StreamHandler()\nhandler.setLevel(logging.DEBUG)\nlogger.addHandler(handler)\nlogger.setLevel(logging.DEBUG)\n\n\nmysql_conf = {\n 'host': '127.0.0.1',\n 'port': 3306,\n 'db': 'test',\n 'user': 'test',\n 'password': 'test'\n}\n\nredis_conf = {\n 'redis_host': '127.0.0.1',\n 'redis_port': 6379,\n 'redis_secret': '',\n}\n\n\nclient = SimpleClient(backend_conf=mysql_conf,\n cache_conf=redis_conf,\n update_interval=30)\n\n\nasync def test():\n await client.connect()\n expire_at = int(time.time()) + 100\n for i in range(10):\n start = int(time.time()*1000)\n result = await client.get(\n database='sku',\n key='select sku_id,description,price,status from sku',\n expire_at=expire_at,\n update_interval=100)\n end = int(time.time()*1000)\n print('running time', end-start)\n print(result, 'result', i)\n\nloop = asyncio.get_event_loop()\n\n# loop.run_until_complete(test())\n\nloop.create_task(test())\nloop.run_forever()\n```\n\n## Coding\n\n* **like this project, star it**\n* **any suggestion is welcome**\n* **this project is under MIT lisense**\n\nmore docs are writing.\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/aohan237/cache_client", "keywords": "asyncio cache client", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "cache-client", "package_url": "https://pypi.org/project/cache-client/", "platform": "any", "project_url": "https://pypi.org/project/cache-client/", "project_urls": { "Homepage": "https://github.com/aohan237/cache_client" }, "release_url": "https://pypi.org/project/cache-client/1.0.0/", "requires_dist": [ "aiomysql (>=0.0.20)", "aioredis (>=1.2.0)", "pyyaml (>=5.1)" ], "requires_python": "", "summary": "README.md", "version": "1.0.0" }, "last_serial": 5296076, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5f997227002827e102697a5539fda156", "sha256": "5282bf8384fae790498e64f00ddb49bba2c8e4fa97d2e30b5e547e9fab7d6dca" }, "downloads": -1, "filename": "cache_client-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5f997227002827e102697a5539fda156", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8503, "upload_time": "2019-05-21T06:22:19", "url": "https://files.pythonhosted.org/packages/50/27/f8d5cef5b72e1bd5805c3fe35bba2cb563e89e8b2629e7cfdf41209844ff/cache_client-1.0.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5f997227002827e102697a5539fda156", "sha256": "5282bf8384fae790498e64f00ddb49bba2c8e4fa97d2e30b5e547e9fab7d6dca" }, "downloads": -1, "filename": "cache_client-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5f997227002827e102697a5539fda156", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8503, "upload_time": "2019-05-21T06:22:19", "url": "https://files.pythonhosted.org/packages/50/27/f8d5cef5b72e1bd5805c3fe35bba2cb563e89e8b2629e7cfdf41209844ff/cache_client-1.0.0-py3-none-any.whl" } ] }