{ "info": { "author": "b3j0f", "author_email": "ib3j0f@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: French", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", "Topic :: Utilities" ], "description": "Description\n-----------\n\nAbstract data request library powered by the python syntax and reflective concerns.\n\n.. image:: https://img.shields.io/pypi/l/b3j0f.requester.svg\n :target: https://pypi.python.org/pypi/b3j0f.requester/\n :alt: License\n\n.. image:: https://img.shields.io/pypi/status/b3j0f.requester.svg\n :target: https://pypi.python.org/pypi/b3j0f.requester/\n :alt: Development Status\n\n.. image:: https://img.shields.io/pypi/v/b3j0f.requester.svg\n :target: https://pypi.python.org/pypi/b3j0f.requester/\n :alt: Latest release\n\n.. image:: https://img.shields.io/pypi/pyversions/b3j0f.requester.svg\n :target: https://pypi.python.org/pypi/b3j0f.requester/\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/implementation/b3j0f.requester.svg\n :target: https://pypi.python.org/pypi/b3j0f.requester/\n :alt: Supported Python implementations\n\n.. image:: https://img.shields.io/pypi/wheel/b3j0f.requester.svg\n :target: https://travis-ci.org/b3j0f/requester\n :alt: Download format\n\n.. image:: https://travis-ci.org/b3j0f/requester.svg?branch=master\n :target: https://travis-ci.org/b3j0f/requester\n :alt: Build status\n\n.. image:: https://coveralls.io/repos/b3j0f/requester/badge.png\n :target: https://coveralls.io/r/b3j0f/requester\n :alt: Code test coverage\n\n.. image:: https://img.shields.io/pypi/dm/b3j0f.requester.svg\n :target: https://pypi.python.org/pypi/b3j0f.requester/\n :alt: Downloads\n\n.. image:: https://readthedocs.org/projects/b3j0frequester/badge/?version=master\n :target: https://readthedocs.org/projects/b3j0frequester/?badge=master\n :alt: Documentation Status\n\n.. image:: https://landscape.io/github/b3j0f/requester/master/landscape.svg?style=flat\n :target: https://landscape.io/github/b3j0f/requester/master\n :alt: Code Health\n\nLinks\n-----\n\n- `Homepage`_\n- `PyPI`_\n- `Documentation`_\n\nInstallation\n------------\n\npip install b3j0f.requester\n\nFeatures\n--------\n\nThis library aims to access to system data from a generic and python API.\n\nReflective concerns permit to not consider only data access with four create/read/update/delete operations but with a more one which is a service execution. Therefore, the main acronym of this library is CRUDE\n\nIn a minimal case, there are 6 concepts to know:\n\n- Driver: in charge of accessing data.\n- Expression and Function: refers to data models and system functions.\n- Transaction: refers to data access transaction.\n- Context: execution context such as a dict where keys are expressions, and values are system data.\n\nLet a data models containing a table 'user' where fields are 'name' and 'age'.\n\nA filter about users of age at least 10 is:\n\n.. code-block:: python\n\n Expression.user.age > 10\n\nA selection of number of users is:\n\n.. code-block:: python\n\n Function.count(Expression.user)\n\nNow, imagine you have two systems, called respectivelly Administration and Club. You might want to get users who have the same name and are at least twenty years old, in both systems like that:\n\n.. code-block:: python\n\n (Expression.Administration.user.name == Expression.Club.user.name) & (Expression.user.age >= 20)\n\nTherefore, all python operators are overriden by the object Expression in order to let you requests in a pythonic way.\n\nExamples\n--------\n\nRefers to a data\n~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from b3j0f.requester import Expression as E, Function as F\n\n # ways to refers to the field 'user.id'.\n E.user.id\n E('user.id')\n E('user').id\n\n # ways to refers to the function 'count' on the data 'user'.\n F.count(E.user)\n F('count')(E.user)\n F('count', params=[E.user])\n\n # In a multi system use, a system is seen such as a data:\n # access to users from a system administration.\n E.Administration.user\n E('Administration.user')\n E('Administration').user\n\nCreate data from a system\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from b3j0f.requester import Driver\n\n class MyDriver(Driver):\n \"\"\"implement your own driver...\"\"\"\n\n driver = MyDriver()\n\n # ways to create data from the request manager\n driver.create(name='C.user', values={'name': 'john'})\n driver.create(name=E.C.user, values={'name': 'john'})\n\n # create several data at once with method chaining and transaction\n with driver.open() as transaction:\n \"\"\"transaction.create(...).update(...)\"\"\"\n\n The with ensure the transaction is commited or rollbacked in case of any error.\n\n trans = driver.open()\n\n # it is also possible to create a hierarchy of transaction with trans.open()\n\n trans.create('C.user', {'name': 'john'}).create(E.C.user, {'name': 'paul'}).process(Create('C.user', {'name': 'david'}), Create(E.C.user, {'name': 'thomas'})).commit()\n\n # create transaction with autocommit and with an historical context\n # autocommit and ctx can be changed at runtime\n trans = driver.open(autocommit=True, ctx=Context())\n\nRead data from a system\n~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from b3j0f.requester import Read as R, Join as J\n\n # get a read resource with specific offset\n crud = driver.read(offset=5)\n\n # add filters\n crud &= (E.A.id == E.B.id) & (F.now > E.B.timestamp)\n # same as\n crud.where(query)\n # and with a \"or\"\n crud.orwhere(query); crud |= query\n\n # method chaining and max 10 data, sorted by A.id and grouped by A.name\n result = crud.sortby(E.A.id).groupby(E.A.name).join('FULL').select()[:10]\n\n for data in result: # display A and B\n print(data['A'], data['B'])\n\n # or get the result via a callback\n crud(async=True, callback=lambda result: None)\n\n # read data with a Read object\n read = R(limit=10, groupby=E.A.name, join=J.FULL, sort=E.A.name)\n result = trans.process(read).ctx[read] # get context request which contain all data from systems and a transaction with autocommit\n\n # read data from the driver with default parameters\n AandB = driver['A', 'B']\n\nUpdate data from a system\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from b3j0f.requester import Update as U\n\n # udpate data from the driver\n driver.update(name='user', values={'name': 'john'})\n driver.update(name=E.user, values={'name': 'john'})\n driver.update(name=E.user, values={'name': 'john'})\n driver[E.user] = {'name': 'john'}\n driver['user'] = {'name': 'john'}\n\n # update data from the transaction\n trans.update(name=E.user, values={'name': 'john'})\n trans.update('user', {'name': 'john'})\n trans['user'] = {'name': 'john'}\n trans[E.user] = {'name': 'john'}\n trans.process(U(name='user', values={'name': 'john'}))\n trans.process(U(name=E.user, values={'name': 'john'}))\n\nDelete data from a system\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from b3j0f.requester import Delete as D\n\n # delete a user from a driver\n driver.delete(names=['user'], query=query)\n driver.delete(names=[E.user], query=query)\n del driver['user']\n del driver[E.user]\n\n # delete a user from a transaction\n trans.delete(names=[D.user], query=query)\n trans.delete(names=['user'], query=query)\n del trans['user']\n del trans[E.user]\n trans.process(names=[D('user')], query=query)\n trans.process(names=[D(E.user)], query=query)\n\nPerspectives\n------------\n\n- wait feedbacks during 6 months before passing it to a stable version.\n- Cython implementation.\n\nDonation\n--------\n\n.. image:: https://liberapay.com/assets/widgets/donate.svg\n :target: https://liberapay.com/b3j0f/donate\n :alt: I'm grateful for gifts, but don't have a specific funding goal.\n\n.. _Homepage: https://github.com/b3j0f/requester\n.. _Documentation: http://b3j0frequester.readthedocs.org/en/master/\n.. _PyPI: https://pypi.python.org/pypi/b3j0f.requester/\n.. _annotation: https://github.com/b3j0f/annotation\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/b3j0f/requester", "keywords": "requester", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "b3j0f.requester", "package_url": "https://pypi.org/project/b3j0f.requester/", "platform": "", "project_url": "https://pypi.org/project/b3j0f.requester/", "project_urls": { "Homepage": "https://github.com/b3j0f/requester" }, "release_url": "https://pypi.org/project/b3j0f.requester/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Python abstract data request library.", "version": "0.0.4" }, "last_serial": 2427462, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8ae6cf43d48d82e22c78adae461db5e8", "sha256": "7816e5f27a823b5ef32412607dfe5d039a0c0003bac24aaae197f03b10721aa5" }, "downloads": -1, "filename": "b3j0f.requester-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8ae6cf43d48d82e22c78adae461db5e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36933, "upload_time": "2016-10-14T00:23:41", "url": "https://files.pythonhosted.org/packages/3c/d0/5a0e3a72c79f9c58bd2432813dc04b1a1c55406ac1ba0a0b5300a949618d/b3j0f.requester-0.0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "cad52d0f6e636f488f4d1a963e8a8588", "sha256": "3b66121bc4e2d9d518507de5ada1cd22c2f996511f8fe9f0ec0e0de7a9b7d56a" }, "downloads": -1, "filename": "b3j0f.requester-0.0.1.zip", "has_sig": false, "md5_digest": "cad52d0f6e636f488f4d1a963e8a8588", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 82359, "upload_time": "2016-10-14T00:23:33", "url": "https://files.pythonhosted.org/packages/12/a3/de5f16c075050bd04e8cfa189c32af815c955a71327d28cc02831d0e4f14/b3j0f.requester-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1a6d1f5d915746efddb64d3ba233ae27", "sha256": "32c4aa5cb53e75dc830ef67291dc52e5c76f997597d2e813ee0541ccccf63cd1" }, "downloads": -1, "filename": "b3j0f.requester-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1a6d1f5d915746efddb64d3ba233ae27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37810, "upload_time": "2016-10-14T13:52:05", "url": "https://files.pythonhosted.org/packages/4e/c9/3e0949ea17e84b49423e1d26b8c5edbfddb588d459ae531eb5d4f8fcd1bb/b3j0f.requester-0.0.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "58fb4f75fab5a9c3328a37b212234752", "sha256": "d2e448aed8a7697f9a37f8ba924a5988e95c7606c64a6e097332d755d0910b7a" }, "downloads": -1, "filename": "b3j0f.requester-0.0.2.zip", "has_sig": false, "md5_digest": "58fb4f75fab5a9c3328a37b212234752", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85063, "upload_time": "2016-10-14T13:52:02", "url": "https://files.pythonhosted.org/packages/62/17/5293f740c39ac5e30a259bd1affcf1dbd854ce8e3450361610e49322da72/b3j0f.requester-0.0.2.zip" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "34945e000bb6a3234cae098e77d6232c", "sha256": "161b91f99dd87b9b233cb7d601b882ac77854490f17d5754d23527446fafca36" }, "downloads": -1, "filename": "b3j0f.requester-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "34945e000bb6a3234cae098e77d6232c", "packagetype": "bdist_wheel", "python_version": "any", "requires_python": null, "size": 79035, "upload_time": "2016-10-26T08:57:22", "url": "https://files.pythonhosted.org/packages/51/a8/b85702a9c4f49f2f4be833a206ce89d83af8de467af985b7366a84c40f2f/b3j0f.requester-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed1bf5c89dfd7fa3217dd1c543870dff", "sha256": "ab2df11bfb3ec716c96ef6590a4e48a25fb6b457855324ed26284057674e364a" }, "downloads": -1, "filename": "b3j0f.requester-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ed1bf5c89dfd7fa3217dd1c543870dff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38006, "upload_time": "2016-10-26T08:55:10", "url": "https://files.pythonhosted.org/packages/a5/34/2a0406e315230b6c4b8c3443756ade56281f37c23341acdb6ff392ec734e/b3j0f.requester-0.0.3.tar.gz" }, { "comment_text": "", "digests": { "md5": "4308e664a1cc891d778a24ad41fd2bad", "sha256": "4b790d04bcb24aac57bc71e287210d4d8fffa48ed1f5bf56763493ea424b14a8" }, "downloads": -1, "filename": "b3j0f.requester-0.0.3.zip", "has_sig": false, "md5_digest": "4308e664a1cc891d778a24ad41fd2bad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85280, "upload_time": "2016-10-26T08:55:08", "url": "https://files.pythonhosted.org/packages/b1/d3/7be82a61f6860100b4b75cc5eacc09a19ee7e35f70c88a4f2e352e19edcb/b3j0f.requester-0.0.3.zip" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "b40b7d27c3a6beb50b5f0cdfe30c4c13", "sha256": "8e47261882a17a0cbe8a91ccd349b912da5d1eecbf88f867f16418438578c9fd" }, "downloads": -1, "filename": "b3j0f.requester-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b40b7d27c3a6beb50b5f0cdfe30c4c13", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 79035, "upload_time": "2016-10-27T23:22:50", "url": "https://files.pythonhosted.org/packages/7a/98/72fb5a0d5e0de87b17a58e98614f710dc5addc83a3589b2130a3c9888d1a/b3j0f.requester-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "381dd10ebec5fd74a041d4e68754795e", "sha256": "fc7ca0124caad4b4b9eea183f3e4cc2da6805801dc2ec32c860688e313c7945d" }, "downloads": -1, "filename": "b3j0f.requester-0.0.4.tar.gz", "has_sig": false, "md5_digest": "381dd10ebec5fd74a041d4e68754795e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38253, "upload_time": "2016-10-27T23:22:47", "url": "https://files.pythonhosted.org/packages/e7/61/663f211f7dd4856f8d1743862b59351e7f5ad38cd4e03f0936954a3207e7/b3j0f.requester-0.0.4.tar.gz" }, { "comment_text": "", "digests": { "md5": "e1fcf05803b82bc81e1ca7bd1044bf18", "sha256": "a93ee9834b3aedbf34f6bb136948664c8f55f082144ae157182d666a2b4edb5b" }, "downloads": -1, "filename": "b3j0f.requester-0.0.4.zip", "has_sig": false, "md5_digest": "e1fcf05803b82bc81e1ca7bd1044bf18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85338, "upload_time": "2016-10-27T23:22:41", "url": "https://files.pythonhosted.org/packages/84/3b/6f126d2f44f58094540759470de1f6695cf47f9fde2fc5e913f7ef62e71d/b3j0f.requester-0.0.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b40b7d27c3a6beb50b5f0cdfe30c4c13", "sha256": "8e47261882a17a0cbe8a91ccd349b912da5d1eecbf88f867f16418438578c9fd" }, "downloads": -1, "filename": "b3j0f.requester-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b40b7d27c3a6beb50b5f0cdfe30c4c13", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 79035, "upload_time": "2016-10-27T23:22:50", "url": "https://files.pythonhosted.org/packages/7a/98/72fb5a0d5e0de87b17a58e98614f710dc5addc83a3589b2130a3c9888d1a/b3j0f.requester-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "381dd10ebec5fd74a041d4e68754795e", "sha256": "fc7ca0124caad4b4b9eea183f3e4cc2da6805801dc2ec32c860688e313c7945d" }, "downloads": -1, "filename": "b3j0f.requester-0.0.4.tar.gz", "has_sig": false, "md5_digest": "381dd10ebec5fd74a041d4e68754795e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38253, "upload_time": "2016-10-27T23:22:47", "url": "https://files.pythonhosted.org/packages/e7/61/663f211f7dd4856f8d1743862b59351e7f5ad38cd4e03f0936954a3207e7/b3j0f.requester-0.0.4.tar.gz" }, { "comment_text": "", "digests": { "md5": "e1fcf05803b82bc81e1ca7bd1044bf18", "sha256": "a93ee9834b3aedbf34f6bb136948664c8f55f082144ae157182d666a2b4edb5b" }, "downloads": -1, "filename": "b3j0f.requester-0.0.4.zip", "has_sig": false, "md5_digest": "e1fcf05803b82bc81e1ca7bd1044bf18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85338, "upload_time": "2016-10-27T23:22:41", "url": "https://files.pythonhosted.org/packages/84/3b/6f126d2f44f58094540759470de1f6695cf47f9fde2fc5e913f7ef62e71d/b3j0f.requester-0.0.4.zip" } ] }