{ "info": { "author": "Markus Zapke-Gr\u00c3\u00bcndemann", "author_email": "info@keimlink.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries" ], "description": "Dedun\n*****\n\nDedun is a Python client for the RESTful API of `API.Leipzig\n`_. This API gives access to the public data of the\ncity of Leipzig. At the moment Dedun can only be used to read from the API.\n\nDedun was a Nubian god worshipped during ancient times and was depicted as a\nlion. The lion is also part of the coat of arms of the city of Leipzig.\n\nInstallation\n============\n\nUse ``pip`` or ``easy_install`` to install the package::\n\n $ pip install dedun\n\nOr install from the sources::\n\n $ wget http://pypi.python.org/packages/source/d/dedun/dedun-0.3.tar.gz\n $ tar xzf dedun-0.3.tar.gz\n $ cd dedun-0.3\n $ python setup.py install\n\nIf you install from the sources or want to run the test suite you have to\ninstall the requirements manually::\n\n $ pip install anyjson>=0.3.1\n\nQuick overview\n==============\n\nYou need a personal API key to use Dedun. You can request an API key at the\n`API.Leipzig website `_.\n\nCreate a Result object\n----------------------\n\nFirst create an instance of a Result class using your API key::\n\n>>> from dedun.resources import MediahandbookCompanies\n>>> comp = MediahandbookCompanies(api_key='XXXXXXXXXXXXXXXXXXXX')\n\nFetch all items\n---------------\n\nNow you can fetch all mediahandbook companies using the all() method::\n\n >>> companies = comp.all()\n >>> print companies\n 1039 mediahandbook/companies items\n\nYou can also use the count() method to get the total number of results::\n\n >>> companies.count()\n 1039\n\nThe Result object is a list consisting of MediahandbookCompaniesResult objects::\n\n >>> companies[0]\n MediahandbookCompaniesResult: Leipziger Universit\u00e4tsverlag GmbH und Akademische Verlagsanstalt AVA\n >>> print companies[0].get_attributes()\n [u'phone_primary', u'people', u'past_customers', u'updated_at', u'street', u'postcode', u'id', u'city', u'email_secondary', u'fax_secondary', u'mobile_secondary', u'housenumber_additional', u'housenumber', u'fax_primary', u'resources', u'main_activity', u'old_id', u'sub_branches', u'sub_market_id', u'mobile_primary', u'url_primary', u'url_secondary', u'name', u'created_at', u'phone_secondary', u'products', u'email_primary', u'main_branch_id']\n >>> print companies[0].name\n Leipziger Universit\u00e4tsverlag GmbH und Akademische Verlagsanstalt AVA\n >>> print companies[0].id\n 1\n >>> print companies[0].email_primary\n info@univerlag-leipzig.de\n\nEach object can be retrieved in JSON::\n\n >>> companies[0].get_json()\n '{\"phone_primary\": \"+49 341 9900440\", \"people\": [1, 2], \"past_customers\": null, \"updated_at\": \"2011-03-14T17:47:47+01:00\", \"street\": \"Oststra\\\\u00dfe\", \"postcode\": \"04317\", \"id\": 1, \"city\": \"Leipzig\", \"email_secondary\": null, \"fax_secondary\": null, \"mobile_secondary\": null, \"housenumber_additional\": null, \"housenumber\": 41, \"fax_primary\": null, \"resources\": null, \"main_activity\": null, \"old_id\": 3, \"sub_branches\": [23], \"sub_market_id\": 3, \"mobile_primary\": null, \"url_primary\": \"http://www.univerlag-leipzig.de\", \"url_secondary\": \"http://www.univerlag-leipzig.de\", \"name\": \"Leipziger Universit\\\\u00e4tsverlag GmbH und Akademische Verlagsanstalt AVA\", \"created_at\": \"2011-02-23T03:06:15+01:00\", \"phone_secondary\": null, \"products\": null, \"email_primary\": \"info@univerlag-leipzig.de\", \"main_branch_id\": 17}'\n\nResult objects can be sorted and reverted::\n\n >>> companies[0]\n MediahandbookCompaniesResult: Leipziger Universit\u00e4tsverlag GmbH und Akademische Verlagsanstalt AVA\n >>> companies.reverse()\n >>> companies[0]\n MediahandbookCompaniesResult: Helden wider Willen e.V.\n >>> companies.order_by('name')\n 1039 mediahandbook/companies items\n >>> companies[0]\n MediahandbookCompaniesResult: (type:g)publishing\n >>> companies[-1]\n MediahandbookCompaniesResult: \u00dcbersetzungsdienst Annett Koch\n\nYou can also use slicing and iteration to get a part of the results::\n\n >>> companies[:10]\n [MediahandbookCompaniesResult: Leipziger Universit\u00e4tsverlag GmbH und Akademische Verlagsanstalt AVA, MediahandbookCompaniesResult: Sittauer Mediendesign, MediahandbookCompaniesResult: Realdesign GmbH, MediahandbookCompaniesResult: Frauenkultur e.V. Leipzig, MediahandbookCompaniesResult: J\u00fcrgen Auge Atelier f\u00fcr Gebrauchs- und Werbegrafik, MediahandbookCompaniesResult: Leipziger St\u00e4dtische Bibliotheken, MediahandbookCompaniesResult: Foto Pampel, MediahandbookCompaniesResult: AECom VERTRIEB, Fachgro\u00dfhandel f\u00fcr Computerzubeh\u00f6r, MediahandbookCompaniesResult: Gesellschaft f\u00fcr Nachrichtenerfassung und Nachrichtenverbreitung, MediahandbookCompaniesResult: OCR Systeme GmbH]\n >>> for c in companies[:10]:\n ... print c.name\n ...\n Leipziger Universit\u00e4tsverlag GmbH und Akademische Verlagsanstalt AVA\n Sittauer Mediendesign\n Realdesign GmbH\n Frauenkultur e.V. Leipzig\n J\u00fcrgen Auge Atelier f\u00fcr Gebrauchs- und Werbegrafik\n Leipziger St\u00e4dtische Bibliotheken\n Foto Pampel\n AECom VERTRIEB, Fachgro\u00dfhandel f\u00fcr Computerzubeh\u00f6r\n Gesellschaft f\u00fcr Nachrichtenerfassung und Nachrichtenverbreitung\n OCR Systeme GmbH\n\n\n\nSearch for items\n----------------\n\nSearch for items using the search() method::\n\n >>> augen = comp.search(name='Auge')\n >>> augen\n 2 mediahandbook/companies items\n >>> for a in augen:\n ... print a.name\n ...\n J\u00fcrgen Auge Atelier f\u00fcr Gebrauchs- und Werbegrafik\n Leipziger Wohnungs- und Baugesellschaft mbH\n >>> leipzig_10 = comp.search(city='Leipzig', limit=10)\n >>> print leipzig_10\n 10 mediahandbook/companies items\n\nGet a single item\n-----------------\n\nFetch a single item using the get() method::\n\n >>> auge = comp.get(name='Auge')\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"dedun/resources.py\", line 59, in get\n raise exceptions.MultipleResults()\n dedun.exceptions.MultipleResults: Your query had multiple results.\n >>> auge = comp.get(name='Auge Atelier')\n >>> print auge\n MediahandbookCompaniesResult: J\u00fcrgen Auge Atelier f\u00fcr Gebrauchs- und Werbegrafik\n >>> comp.get(id=232323)\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"dedun/resources.py\", line 60, in get\n return result[0]\n File \"dedun/results.py\", line 103, in __getitem__\n raise exceptions.ObjectNotFound('Item not found.')\n dedun.exceptions.ObjectNotFound: Item not found.\n\nActivate debugging\n------------------\n\nCreate a new instance to activate debugging::\n\n >>> comp_debug = MediahandbookCompanies(api_key='XXXXXXXXXXXXXXXXXXXX', debug=True)\n >>> comp_debug.all()\n http://www.apileipzig.de/api/v1/mediahandbook/companies?api_key=XXXXXXXXXXXXXXXXXXXX&format=json\n 1039 mediahandbook/companies items\n >>> comp_debug.get(id=23)\n http://www.apileipzig.de/api/v1/mediahandbook/companies/search?api_key=XXXXXXXXXXXXXXXXXXXX&id=23&format=json\n MediahandbookCompaniesResult: Kleines Werbeteam\n\nAvailable Resource classes\n--------------------------\n\n- CalendarEvents\n- CalendarHosts\n- CalendarVenues\n- DistrictDistricts\n- DistrictIhkcompanies\n- DistrictStatistics\n- DistrictStreets\n- MediahandbookBranches\n- MediahandbookCompanies\n- MediahandbookPeople\n\nRunning the test suite\n======================\n\nTo run the test suite you need the Dedun source code. There are two ways to\nobtain it.\n\n#. Clone the Mercurial repository from BitBucket_::\n\n $ hg clone https://bitbucket.org/keimlink/dedun\n\n.. _BitBucket: https://bitbucket.org/keimlink/dedun\n\n#. Download the package from PyPI_ and unpack it::\n\n $ wget http://pypi.python.org/packages/source/d/dedun/dedun-0.3.tar.gz\n $ tar xzvf dedun-0.3.tar.gz\n\n.. _PyPI: http://pypi.python.org/pypi/dedun\n\nAll test are written using `py.test`_. You can execute them without having\npy.test installed. The only prerequisite is the installation of the previously\nmentioned requirements::\n\n $ pip install anyjson>=0.3.1\n\n.. _py.test: http://pytest.org/\n\nRun the test suite using ``python setup.py test`` (no py.test installation\nrequired). The tests requiring the local HTTP server will automatically be\nskipped::\n\n $ python setup.py test\n ================================================= test session starts ==================================================\n platform darwin -- Python 2.6.1 -- pytest-2.1.2\n collected 37 items\n\n tests/test_resources.py ..sss...sss.\n tests/test_results.py .........................\n\n ========================================= 31 passed, 6 skipped in 0.40 seconds =========================================\n\nTo run the tests which mock HTTP requests using a local test server you need\nadditional packages::\n\n $ pip install pytest pytest-localserver\n\nAfter installing the packages you can run all tests::\n\n $ python setup.py test\n ================================================= test session starts ==================================================\n platform darwin -- Python 2.6.1 -- pytest-2.1.2\n collected 37 items\n\n tests/test_resources.py ............\n tests/test_results.py .........................\n\n ============================================== 37 passed in 3.47 seconds ===============================================\n\nIf you want to skip the tests using the local HTTP server on purpose you can\ndo it this way::\n\n $ py.test --no-localserver\n ================================================= test session starts ==================================================\n platform darwin -- Python 2.6.1 -- pytest-2.1.3\n collected 37 items\n\n tests/test_resources.py ..sss...sss.\n tests/test_results.py .........................\n\n ========================================= 31 passed, 6 skipped in 0.41 seconds =========================================\n\nReporting bugs\n==============\n\nIf you find bugs or have ideas for new features please use the `issue tracker`_.\n\n.. _issue tracker: https://bitbucket.org/keimlink/dedun/issues\n\nContributing\n============\n\nDevelopment happens at BitBucket_. You are highly encouraged to participate in\nthe development.\n\nLicense\n=======\n\nThis software is licensed under the New BSD License. See the LICENSE file in\nthe top distribution directory for the full license text.\n\n\nChangelog\n*********\n\n0.3.2\n=====\n\n- Removed deprecated __getslice__ method from dedun.results.\n- Added commands for coverage and pylint to setup.py.\n- Better solution for deprecated import::\n\n from dedun import MediahandbookCompanies\n\n- Removed runtests.py from py_modules.\n\n0.3.1\n=====\n\n- Added versiontools >= 1.8 setup requirement.\n\n0.3.0\n=====\n\n- Fixed issue #1: Slicing does not respect reverse() method.\n- Added new method ResultBase.get_json.\n- Added test suite (using py.test).\n- Reorganized code as a Python package.\n- Using BSD license now.\n- Requires now anyjson >= 0.3.1.\n\n0.2.5\n=====\n\n- Added new Results methods order_by and reverse.\n\n0.2.4\n=====\n\n- Fixed installation instructions.\n\n0.2.3\n=====\n\n- Fixed setup.py encodings (again).\n\n0.2.2\n=====\n\n- Fixed setup.py encodings.\n\n0.2.1\n=====\n\n- Minor fixes.\n\n0.2.0\n=====\n\n- New Resource and Result classes.\n- Added debug argument to Resource classes.\n- New ObjectNotFound, ImproperlyConfigured and MultipleResults exceptions.\n\n0.1.0\n=====\n\n- Initial release. Supports only JSON. Documentation and tests will come with\n future releases.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/keimlink/dedun", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "dedun", "package_url": "https://pypi.org/project/dedun/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dedun/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/keimlink/dedun" }, "release_url": "https://pypi.org/project/dedun/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "Dedun is a Python client for the RESTful API of API.Leipzig. This API gives access to the public data of the city of Leipzig.", "version": "0.3.2" }, "last_serial": 788880, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "44603f139e635a024df985e236fde2a9", "sha256": "9960392367799cb90f598c97940dbf7e7bbc5f762cee887d9e5e40ebb6ddd2b8" }, "downloads": -1, "filename": "dedun-0.2.tar.gz", "has_sig": false, "md5_digest": "44603f139e635a024df985e236fde2a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5615, "upload_time": "2011-08-17T15:39:47", "url": "https://files.pythonhosted.org/packages/3b/25/4d2e8d51d23a93dd9e526dc04625a62c29df595eda3a0ca4f8d073d5afd5/dedun-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0e179f25794f47bfe8423a4a6abcb492", "sha256": "65935c6434b70951eab5f06e08d1af1bc26002be8b0db2faad718477cd67c862" }, "downloads": -1, "filename": "dedun-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0e179f25794f47bfe8423a4a6abcb492", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5627, "upload_time": "2011-08-17T15:40:18", "url": "https://files.pythonhosted.org/packages/ae/48/bb355b8717e2a35634b662c2b1cac2852dab3c66037161c44d23dfc5f2d0/dedun-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "aa742ec9c2e5941b6df918b36f53fd66", "sha256": "10ebb557f5c5aa873335b5dd3e52dfe12057dcf8cb3b7a36c0b90ded4e845f83" }, "downloads": -1, "filename": "dedun-0.2.2.tar.gz", "has_sig": false, "md5_digest": "aa742ec9c2e5941b6df918b36f53fd66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5102, "upload_time": "2011-08-17T15:46:37", "url": "https://files.pythonhosted.org/packages/bc/b4/e347400848e04455740ba08b876b526f6daf0652137dd05bc8c2b9fb8416/dedun-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "07d24f884df34e34e6698264f33ed043", "sha256": "bed197563f38a17bbbfd71d31fcdcde3a62e0e3479e5646ba7247851baca0d33" }, "downloads": -1, "filename": "dedun-0.2.3.tar.gz", "has_sig": false, "md5_digest": "07d24f884df34e34e6698264f33ed043", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5686, "upload_time": "2011-08-17T15:47:54", "url": "https://files.pythonhosted.org/packages/aa/f0/6851d0d8985a51afc429bb8e2e24419fe21db3fdcd9cb7d08dfe09864505/dedun-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "d400e4259d4ce4ef4e70db73c03c4ea0", "sha256": "2035df47eacb4b5c48b67aaed847b390a085bd5ca9977ac38399409c09e96176" }, "downloads": -1, "filename": "dedun-0.2.4.tar.gz", "has_sig": false, "md5_digest": "d400e4259d4ce4ef4e70db73c03c4ea0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5760, "upload_time": "2011-09-24T18:04:26", "url": "https://files.pythonhosted.org/packages/e5/98/fc00afcc1c442a9c251cb840e0c4d56048f6f0f2e486d28bbfe62f9d33e2/dedun-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "a0a6781c3835f11cf182b9e6b7678729", "sha256": "8fd73b007710a8069293b220b25cb148659d2c8eb9efa3df179244a54a4ed95f" }, "downloads": -1, "filename": "dedun-0.2.5.tar.gz", "has_sig": false, "md5_digest": "a0a6781c3835f11cf182b9e6b7678729", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5977, "upload_time": "2011-09-25T04:11:50", "url": "https://files.pythonhosted.org/packages/2d/ee/a34a7ec09cb30f5b381b1a738727c2f1ed21183454cae749caeb489e8605/dedun-0.2.5.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "4fb81101613dba99721ab37374ec1c3a", "sha256": "90e982a01d835fe4c6cb0230a29262cae4b1c84f14a27e8f580a2aa7879d5fc8" }, "downloads": -1, "filename": "dedun-0.3.tar.gz", "has_sig": false, "md5_digest": "4fb81101613dba99721ab37374ec1c3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 154080, "upload_time": "2011-11-23T09:03:20", "url": "https://files.pythonhosted.org/packages/24/36/a328e19e638533cfe80b82e1b1a7795c288908cc4df641b07e871924fbb5/dedun-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "608c9e5870ee6d90f81c2fd7fac57205", "sha256": "5e76a8eb3bd3810273977d41bb2598e8f97fe3d0c21a98c21022c1e7270dbc1b" }, "downloads": -1, "filename": "dedun-0.3.1.tar.gz", "has_sig": false, "md5_digest": "608c9e5870ee6d90f81c2fd7fac57205", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 154139, "upload_time": "2011-11-23T14:30:28", "url": "https://files.pythonhosted.org/packages/17/f9/782dac7376a1a93386ea4346a289247dd65fba2550a992caa942bde5e4f6/dedun-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "09d46c0178f6ac537c5e4ca4096b25e7", "sha256": "0a01efc04ea7804d3701fa46d0655d52ac2ca691bd6d59c8d2f4259290d9316a" }, "downloads": -1, "filename": "dedun-0.3.2.tar.gz", "has_sig": false, "md5_digest": "09d46c0178f6ac537c5e4ca4096b25e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 154672, "upload_time": "2011-11-24T10:55:31", "url": "https://files.pythonhosted.org/packages/87/d3/50ef228f7f8cb369fbdbce21fea6dc127dcf4dfda6fe2c9d510bc46bb207/dedun-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09d46c0178f6ac537c5e4ca4096b25e7", "sha256": "0a01efc04ea7804d3701fa46d0655d52ac2ca691bd6d59c8d2f4259290d9316a" }, "downloads": -1, "filename": "dedun-0.3.2.tar.gz", "has_sig": false, "md5_digest": "09d46c0178f6ac537c5e4ca4096b25e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 154672, "upload_time": "2011-11-24T10:55:31", "url": "https://files.pythonhosted.org/packages/87/d3/50ef228f7f8cb369fbdbce21fea6dc127dcf4dfda6fe2c9d510bc46bb207/dedun-0.3.2.tar.gz" } ] }