{ "info": { "author": "Ozzy", "author_email": "cfhamlet@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# os-dbnetget\n\n[![Build Status](https://www.travis-ci.org/cfhamlet/os-dbnetget.svg?branch=master)](https://www.travis-ci.org/cfhamlet/os-dbnetget)\n[![codecov](https://codecov.io/gh/cfhamlet/os-dbnetget/branch/master/graph/badge.svg)](https://codecov.io/gh/cfhamlet/os-dbnetget)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/os-dbnetget.svg)](https://pypi.python.org/pypi/os-dbnetget)\n[![PyPI](https://img.shields.io/pypi/v/os-dbnetget.svg)](https://pypi.python.org/pypi/os-dbnetget)\n\nLibrary and command line tool not just for qdb.\n\nThis project implement a python qdb toolkit as dbnetget at first. With the progress of development, it is separated into multiple sub-projects as [os-qdb-protocal](https://github.com/cfhamlet/os-qdb-protocal), [os-m3-engine](https://github.com/cfhamlet/os-m3-engine), this project become a framework for similar works not just for qdb.\n\nThe main components are client libraries and command line tool.\n\nClient is used for network processing(connect, close, send, receive, etc.) . It is protocol-independent and transparent to user. By now, there are sync/tornado-async clients, thread-safe client pool and tornado-async client pool are also convenient.\n\nCommand line tool's features can be extended by installing extra packages. See [Install](#install).\n\n\n\nGreatly appreciate [**Bear Tian**](http://i.youku.com/i/UMTk2ODI0MjI0) and his dbnetget!\n\n\n# Install\n\n* install package\n ```\n pip install os-dbnetget\n ```\n\n* install extra packages\n\n | subpackage | install command | enables |\n | :--------- | :-------------- | :------ |\n |m3 | ``pip install os-dbnetget[m3]`` | Install [m3](https://github.com/cfhamlet/os-m3-engine) for command line tool support m3(multi-thread) engine |\n | tornado | ``pip install os-dbnetget[tornado]`` | Install [Tornado](https://github.com/tornadoweb/tornado) for async client and command line tool support tornado engine |\n | rotate | ``pip install os-dbnetget[rotate]`` | Enable write data to rotate file |\n\n\n# Client API\n\nThere are sync/async clients, generally speaking, you should not use them directly. The pool may be your first choice. \n\n## SyncClientPool\n\n* native multi-thread, do not need extra packages\n* thread safe\n* retry when network error\n* support multi connections with one endpoint\n\n\n\nExample:\n\n```python\nfrom os_qdb_protocal import create_protocal\nfrom os_dbnetget.commands.qdb import qdb_key\nfrom os_dbnetget.clients.sync_client import SyncClientPool\n\nendpoints = ['host%02d:8012' % i for i in range(1, 10)]\npool = SyncClientPool(endpoints)\n\nproto = create_protocal('test', qdb_key(b'test-key'))\nresult = pool.execute(proto)\n\npool.close()\n```\n\n\n\n\n\n## TornadoClientPool\n\n* support tornado async\n* retry when network error\n* support multi connections with one endpoint\n\n\n\nExample:\n\n```python\nfrom tornado import gen\nfrom tornado.ioLoop import IOLoop\n\nfrom os_qdb_protocal import create_protocal\nfrom os_dbnetget.commands.qdb import qdb_key\nfrom os_dbnetget.clients.tonado_client import TornadoClientPool\n\n@gen.coroutine\ndef main():\n \n endpoints = ['host%02d:8012' % i for i in range(1, 10)]\n pool = TornadoClientPool(endpoints)\n\n proto = create_protocal('test', qdb_key(b'test-key'))\n result = yield pool.execute(proto)\n\n yield pool.close()\n\nIOLoop.current().run_sync(main)\n```\n\n\n\n\n\n# Command line\n\n* command line tool is on progress, the supported sub-commands:\n\n ```\n os-dbnetget -h\n ```\n\n* each sub-command has is own features\n\n ```\n os-dbnetget [sub-command] -h\n ```\n \n* some extra packages can be installed for enhancement, see [Install](#install)\n\n for example, you can install m3 engine to improve processing capacity\n\n ```\n pip install os-dbnetget[m3]\n ```\n\n ```\n cat data.txt | os-dbnetget test --engine m3 --thread-num 50 -L endpoints.lst\n ```\n\n\n\n\n# Unit Tests\n\n`$ tox`\n\n# License\n\nMIT licensed.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cfhamlet/os-dbnetget", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "os-dbnetget", "package_url": "https://pypi.org/project/os-dbnetget/", "platform": "", "project_url": "https://pypi.org/project/os-dbnetget/", "project_urls": { "Homepage": "https://github.com/cfhamlet/os-dbnetget" }, "release_url": "https://pypi.org/project/os-dbnetget/0.1.3/", "requires_dist": null, "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "summary": "qdb async client.", "version": "0.1.3" }, "last_serial": 4668526, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "583b37f3c6cd514267caca65d8c0c541", "sha256": "99d2eae40b3f3894a2d81eee539be7518bcbcd1c65fa3e8376caa63131a926dd" }, "downloads": -1, "filename": "os-dbnetget-0.1.tar.gz", "has_sig": false, "md5_digest": "583b37f3c6cd514267caca65d8c0c541", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14436, "upload_time": "2018-12-12T08:14:38", "url": "https://files.pythonhosted.org/packages/e5/47/5f184ff140277ba5dfa3161c3bf3a127f8d0202217e1a092b306ba4a29ab/os-dbnetget-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "0d628b99a508c30a82167fc7bd25fc0e", "sha256": "daf05e9e2c7c50a47c263423b41abfeb3a53e9ba7d97024843f69d57b6881ec5" }, "downloads": -1, "filename": "os-dbnetget-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0d628b99a508c30a82167fc7bd25fc0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19172, "upload_time": "2018-12-14T13:09:14", "url": "https://files.pythonhosted.org/packages/b4/c5/17b285382b0abee72f8d88f7d03111f5260319e1f76e54152aab6e4568e6/os-dbnetget-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8262966c49ef26164744e25da519e7bc", "sha256": "15b2db28a4e5ab3afd939828a3ca9d336b8d06aacf57a8b19b985184646919c1" }, "downloads": -1, "filename": "os-dbnetget-0.1.2.tar.gz", "has_sig": false, "md5_digest": "8262966c49ef26164744e25da519e7bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19415, "upload_time": "2018-12-17T15:20:54", "url": "https://files.pythonhosted.org/packages/44/f2/d3ca4ecf751f1d661c3b5a1aa0fe0d3e7c4babeb0f5ac25eb73d86b0c7d8/os-dbnetget-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6c6006ec482ded3041fa8ccd643c6590", "sha256": "ebcfff3c8b3b6a6385ce88677dcc87368aa2edf2e1337835dcebd4906bdcb297" }, "downloads": -1, "filename": "os-dbnetget-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6c6006ec482ded3041fa8ccd643c6590", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 19587, "upload_time": "2019-01-07T13:07:38", "url": "https://files.pythonhosted.org/packages/1b/07/a76c21d7e6c3ee4029593efb6c48efd75573978ea576b0929db8a95d3d6c/os-dbnetget-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6c6006ec482ded3041fa8ccd643c6590", "sha256": "ebcfff3c8b3b6a6385ce88677dcc87368aa2edf2e1337835dcebd4906bdcb297" }, "downloads": -1, "filename": "os-dbnetget-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6c6006ec482ded3041fa8ccd643c6590", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", "size": 19587, "upload_time": "2019-01-07T13:07:38", "url": "https://files.pythonhosted.org/packages/1b/07/a76c21d7e6c3ee4029593efb6c48efd75573978ea576b0929db8a95d3d6c/os-dbnetget-0.1.3.tar.gz" } ] }