{ "info": { "author": "Anton Baklanov", "author_email": "antonbaklanov@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: POSIX :: BSD", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries" ], "description": ":version: 0.2.1\n\n|build_status|_\n\n.. |build_status| image:: https://api.travis-ci.org/bak1an/pygibson.png\n.. _build_status: https://travis-ci.org/bak1an/pygibson\n\npygibson\n========\n\nPython client for gibson_ cache server.\n\n.. _gibson: http://gibson-db.in/\n\n\nWhich python versions are supported?\n------------------------------------\n\nCurrently testsuite runs with python 2.6, 2.7, 3.2 and 3.3.\n\nAll tests are passing successfully with PyPy 2.0.2 but since pygibson is\nimplemented as CPython extension it's not recommended to use it with PyPy. We\nneed to find some workaround to this later.\n\n\nHow to install?\n---------------\n::\n\n pip install pygibson\n\nor\n\n::\n\n git clone https://github.com/bak1an/pygibson.git\n cd pygibson\n git submodule update --init\n python setup.py install\n\n\nHow to use?\n-----------\n\n\n.. code:: python\n\n from pygibson import Client\n from pygibson import NotFoundError\n\n cl = Client() # defaults, 127.0.0.1:10128, timeout=1000\n cl2 = Client(host=\"192.168.1.33\", port=4321, timeout=1500) # non defaults\n cl3 = Client(unix_socket=\"/var/run/gibson.sock\", timeout=500) # connects to unix socket with timeout set to 500\n\n cl.set(\"some_key\", \"some_value\")\n print cl.get(\"some_key\") # \"some_value\" will be printed\n try:\n cl.get(\"no_such_key\")\n except NotFoundError:\n print \"Yay, no such key!\"\n\n\nClient() class methods\n----------------------\n\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| Method name | Parameters | Description |\n+=============+===================+===================================================================================+\n| __init__ | host=\"127.0.0.1\", | If *unix_socket* is None connects to **host**:**port**, |\n| | port=10128, | otherwise connects to given **unix_socket**. *timeout* parameter |\n| | unix_socket=None, | can be used to set timeout for IO operations. |\n| | timeout=1000 | Default is 1000ms. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| set_ | key, value, ttl=0 | Required parameters are key and value. |\n| | | Optional parameter *ttl* can be used to set entry TTL in seconds. |\n| | | Default is 0, which means infinite TTL. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| mset_ | prefix, value | Set **value** for all keys which are starting |\n| | | with **prefix**. This method will raise *NotFoundError* if there are no keys |\n| | | starting with **prefix** at server. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| ttl_ | key, ttl | Set TTL in seconds for **key**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| mttl_ | prefix, ttl | Set TTL in seconds for all keys string with **prefix**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| get_ | key | Get value for given **key**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| mget_ | prefix | Get values for keys starting with **prefix**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| dl_ | key | Delete given **key** from server. Renamed to *dl* to avoid clashes with |\n| | | python's keyword. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| mdl_ | prefix | Delete keys starting with **prefix** from server. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| inc_ | key | Increment **key** by 1. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| minc_ | prefix | Increment keys starting with **prefix** by 1. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| dec_ | key | Decrement **key** by 1. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| mdec_ | prefix | Decrement keys starting with **prefix** by 1. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| lock_ | key, time | Lock **key** for **time** seconds. Any write operations to that key will fail |\n| | | and *LockedError* will be raised. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| unlock_ | key | Unlock **key**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| mlock_ | prefix, time | Lock keys starting with **prefix** for **time** seconds. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| munlock_ | prefix | Unlock keys starting with **prefix**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| count_ | prefix | Get count of keys starting with **prefix**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| meta_ | key, field | Get useful info about *key*. Allowed values for **field** are: 'size', 'encoding' |\n| | | 'access', 'created', 'ttl', 'left', 'lock'. Click method's name in first column |\n| | | for details ;) |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| keys_ | prefix | Get list of keys starting with **prefix**. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| stats_ | | Get useful statistics from server. See gibson protocol docs for details. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| ping_ | | Ping server. Raise *PyGibsonError* if failed. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n| quit_ | | Disconnect. |\n+-------------+-------------------+-----------------------------------------------------------------------------------+\n\n :NOTE: values packed in **bytes** are returned from *get*, *mget* and *keys* under python 3.\n\n.. _set: http://gibson-db.in/command-set.php\n.. _mset: http://gibson-db.in/command-mset.php\n.. _ttl: http://gibson-db.in/command-ttl.php\n.. _mttl: http://gibson-db.in/command-mttl.php\n.. _get: http://gibson-db.in/command-get.php\n.. _mget: http://gibson-db.in/command-mget.php\n.. _dl: http://gibson-db.in/command-del.php\n.. _mdl: http://gibson-db.in/command-mdel.php\n.. _inc: http://gibson-db.in/command-inc.php\n.. _minc: http://gibson-db.in/command-minc.php\n.. _mdec: http://gibson-db.in/command-mdec.php\n.. _dec: http://gibson-db.in/command-dec.php\n.. _lock: http://gibson-db.in/command-lock.php\n.. _mlock: http://gibson-db.in/command-mlock.php\n.. _unlock: http://gibson-db.in/command-unlock.php\n.. _munlock: http://gibson-db.in/command-munlock.php\n.. _count: http://gibson-db.in/command-count.php\n.. _meta: http://gibson-db.in/command-meta.php\n.. _keys: http://gibson-db.in/command-keys.php\n.. _stats: http://gibson-db.in/command-stats.php\n.. _ping: http://gibson-db.in/command-ping.php\n.. _quit: http://gibson-db.in/command-quit.php\n\n\nExceptions\n----------\n\nHere is a list of exceptions which are available in **pygibson** module:\n\n+---------------+------------------------------------------------------------------------+\n| Exception | Description |\n+===============+========================================================================+\n| PyGibsonError | Generic error. raised when REPL_ERR received from server |\n| | or any other error occurred (connection refused, timeout, etc). |\n| | All other pygibson exceptions are subclassed from this one |\n+---------------+------------------------------------------------------------------------+\n| NotFoundError | Not found error. Raised when REPL_ERR_NOT_FOUND received from server |\n+---------------+------------------------------------------------------------------------+\n| NaNError | Not a number. Raised from **inc**, **minc**, **dec** and **mdec** when |\n| | incrementing/decrementing not a numerical values |\n+---------------+------------------------------------------------------------------------+\n| NoMemoryError | Raised when server has no free memory for your stuff |\n+---------------+------------------------------------------------------------------------+\n| LockedError | Raised when values that you are trying to modify are locked |\n+---------------+------------------------------------------------------------------------+\n\n\nRoadmap\n=======\n\n- Connection pool\n- Ability to connect multiple servers\n- Better pypy support\n\n\nLicense\n=======\n\npygibson code is distributed under MIT license conditions, see LICENSE for\ndetails.\n\npygibson distribution includes bundled copy of libgibsonclient_ library which is written by\nSimone Margaritelli and distributed on terms of BSD license.\n\n.. _libgibsonclient: https://github.com/evilsocket/libgibsonclient", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bak1an/pygibson", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pygibson", "package_url": "https://pypi.org/project/pygibson/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pygibson/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bak1an/pygibson" }, "release_url": "https://pypi.org/project/pygibson/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Python client for gibson cache server", "version": "0.2.1" }, "last_serial": 1661056, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1fc40a213807318cf48053d6a2b655cb", "sha256": "0c5bb5d69e5ea0ee672245e506d35b4a92b2b9ddcb584e897492595f8e3d44d7" }, "downloads": -1, "filename": "pygibson-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1fc40a213807318cf48053d6a2b655cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18844, "upload_time": "2013-08-13T21:07:41", "url": "https://files.pythonhosted.org/packages/1d/61/dbebb88a24e0045786729918dc9c08311976108968d0927d6b4ae84d3eee/pygibson-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1a2e386531f03ee87ec4bdfc050c0cbe", "sha256": "b6bc45c72d10d29e50cb4b82268c5f08bc6b899485597c12971cc6a647a8a552" }, "downloads": -1, "filename": "pygibson-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1a2e386531f03ee87ec4bdfc050c0cbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19346, "upload_time": "2013-08-28T20:09:29", "url": "https://files.pythonhosted.org/packages/14/8e/262cafa6e4e27c044aef6cbbc50d55010b40f6946d9ad8474d02e9394f79/pygibson-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "58a492c28c208702de585d32d43c1aa8", "sha256": "74991becfabd5702435bb0a540377df33580eaf90dbeb6ef21e64da0c4d1266f" }, "downloads": -1, "filename": "pygibson-0.2.1.tar.gz", "has_sig": false, "md5_digest": "58a492c28c208702de585d32d43c1aa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19816, "upload_time": "2015-08-02T20:38:48", "url": "https://files.pythonhosted.org/packages/49/ce/18e324897ae11b3a9f271e3780fe5ffa169ac980a47eb9c14077f586ebda/pygibson-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "58a492c28c208702de585d32d43c1aa8", "sha256": "74991becfabd5702435bb0a540377df33580eaf90dbeb6ef21e64da0c4d1266f" }, "downloads": -1, "filename": "pygibson-0.2.1.tar.gz", "has_sig": false, "md5_digest": "58a492c28c208702de585d32d43c1aa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19816, "upload_time": "2015-08-02T20:38:48", "url": "https://files.pythonhosted.org/packages/49/ce/18e324897ae11b3a9f271e3780fe5ffa169ac980a47eb9c14077f586ebda/pygibson-0.2.1.tar.gz" } ] }