{ "info": { "author": "Erik Aker", "author_email": "eraker@gmail.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Description\n============\n\nThis package has been designed to facilitate browsing and retrieving content \nfrom the Public Media Platform (PMP) API. It makes it easy to generate signed \nrequests and browser hypermedia resources returned by the PMP API.\n\nFor more information about PMP, `read the documentation \n`_\n\nThis application has been created at KBPS Public Broadcasting in San Diego by \nErik Aker and it has been licensed under GPL v2.\n\nTo Do\n-----\n\n1. Testing: pmp_client module requires unit-tests\n2. Documentation: Clean and write more.\n3. Create Collectiondoc class for creating new collectiondocs\n\nInstallation\n============\n\npy3-pmp-wrapper has been written for Python3.3 and Python3.4. It is not \ncompatible with Python2.7 and below. All references below to installing this \napplication refer only to Python versions 3.3 and 3.4.\n\n\nDistribute & Pip\n----------------\n\nTo install py3-pmp-wrapper with `pip `_, just run\nthis in your terminal::\n\n $ pip install py3-pmp-wrapper\n\nor, with `easy_install `_::\n\n $ easy_install py3-pmp-wrapper\n\n\nGet the Code\n------------\n\npy3-pmp-wrapper is on GitHub, where the code is\n`available `_.\n\nYou can clone the public repository::\n\n $ git clone https://github.com/KPBS/py3-pmp-wrapper\n\nOnce you have a copy of the source, you can embed it in your Python package,\nor install it into your site-packages easily::\n\n $ python setup.py install\n.. _quickstart:\n\nQuickstart\n==========\n\nCreate a PMP Client\n-------------------\n\nAfter the application has been installed, you can create a `Client` object:\n\n >>> from pmp_api.pmp_client import Client\n >>> client = Client(\"https://api-pilot.pmp.io\")\n\n\nAuthenticate Your Client\n------------------------\n\nWith a working client, you will need to authenticate using your client-id and \nclient-secret\n\n >>> client.gain_access(CLIENT-ID, CLIENT-SECRET)\n\n\nMake Requests\n-------------\n\nNow you're ready to make requests:\n\n >>> home_doc = client.home() # Get homedoc\n >>> random_request = client.get(\"https://Some/arbitrary/endpoint?params=someparam\")\n >>> random_request\n \n >>> client.document # Most recent result is saved here\n \n\nThe `Client` will automatically sign all requests and it should renew your \naccess token if it expires.\n\nNavigating\n----------\n \nUsing the fetched document's `navigation` object, the `Client` can follow \nnavigation, if it's present:\n\n # If the document defines a 'next' navigation element, we can follow it\n >>> client.next() \n \n >>> client.prev() # Same as above, returns None if nothing there...\n >>>\n >>> client.last() # requests 'last' page of results as given by document\n >>> client.first() # requests 'first' page of results as given by document\n\nWe can also go `back` or `forward`, like a browser, re-requesting the previous \ndocument:\n\n >>> client.document\n \n >>> client.back() # This issues a new request; does not pull from cache\n \n >>> client.forward() # same as `back`\n \n\n\nMost of the useful navigation is done via `urn`, the primary method for \naccessing content, and the Client object provides a `query` method for use with \na `urn`. For example, let's look at `urn:collectiondoc:query:docs`, which \ncontains information for querying documents.\n\n >>> document = client.query('urn:collectiondoc:query:docs', \n \t\t \t\tparams={\"tag\": \"samplecontent\", \n\t\t\t\t \"profile\": \"story\"})\n \n\nNavigableDoc objects\n====================\n\nTo really get interesting information back, we need to have some way of \nmanaging it. For this reason, the `Client` object returns `NavigableDoc` \nelements. These have a number of methods and properties, which should make it \neasier to extract information from the document.\n\n >>> document = client.query('urn:collectiondoc:query:docs', \n \t\t \t\tparams={\"tag\": \"samplecontent\", \n\t\t\t\t\t\"profile\": \"story\"})\n \n >>> document.links\n {'item': [{'href': 'https://api-pilot.pmp.io/docs/SOMEGUID ...\n >>> client.document.items\n [{'attributes': {'valid': {'to': '3014-07-29T18:08:11+00:00', 'from': ...\n >>> document.querylinks\n [{'rels': ['urn:collectiondoc:query:users'], 'href-template': ...\n\nIn order to get interesting results back, we generally want to issue queries, \nbut it can be tough to know how to make queries. The `NavigableDoc` object can \nhelp with that.\n\n >>> document.template('urn:collectiondoc:query:docs')\n 'https://api-pilot.pmp.io/docs{?guid,limit,offset,tag,collection,text,searchsort,has,author,distributor,distributorgroup,startdate,enddate,profile,language}'\n\nIn addition, we can find options associated with the `urn`:\n\n >>> document.options('urn:collectiondoc:query:docs')\n {'rels': ['urn:collectiondoc:query:docs'], 'href-template': ...\n\nWhat if we want to know which `urns` are listed at a particular endpoint? We \nmust ask the document for its `query_types`:\n\n >>> for item in document.query_types():\n ... print(item)\n ('Query for users', ['urn:collectiondoc:query:users'])\n ('Query for schemas', ['urn:collectiondoc:query:schemas'])\n ('Access documents', ['urn:collectiondoc:hreftpl:docs'])\n ('Query for documents', ['urn:collectiondoc:query:docs'])\n etc.\n\nFinally, you can always retrieve all of the results inside a document by \naccessing its `collectiondoc` attribute. This will return a dictionary of all \nvalues contained in the document:\n\n >>> document.collectiondoc\n {ALL-The_Data ...}\n\nThis should cover most use-cases for browsing PMP API content.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/KPBS/py3-pmp-wrapper.git", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/KPBS/py3-pmp-wrapper", "keywords": "pmp,hateoas", "license": "GNU General Public License v2", "maintainer": null, "maintainer_email": null, "name": "py3-pmp-wrapper", "package_url": "https://pypi.org/project/py3-pmp-wrapper/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/py3-pmp-wrapper/", "project_urls": { "Download": "https://github.com/KPBS/py3-pmp-wrapper.git", "Homepage": "https://github.com/KPBS/py3-pmp-wrapper" }, "release_url": "https://pypi.org/project/py3-pmp-wrapper/0.5.0/", "requires_dist": null, "requires_python": null, "summary": "Python3 Wrapper Interface for Public Media Platform API", "version": "0.5.0" }, "last_serial": 1228640, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "369aa59f1c0f458790a74f710e3d2f21", "sha256": "5540f7597dab301d711800ba41c136370188b1dc7eea2213150673fa049e247f" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.2.0.tar.gz", "has_sig": false, "md5_digest": "369aa59f1c0f458790a74f710e3d2f21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26443, "upload_time": "2014-07-29T22:18:10", "url": "https://files.pythonhosted.org/packages/94/f5/86ca5070a4ec4769e59d416c85b99d3abea66d5fb11c32488d161d89b891/py3-pmp-wrapper-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "bbad9d5efa1c042f110555dcc83f428f", "sha256": "ab97139d597d3b7fabddf6c5899cddc503a1d8bd3c08ee95f788fcdc994f5f48" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.3.0.tar.gz", "has_sig": false, "md5_digest": "bbad9d5efa1c042f110555dcc83f428f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26346, "upload_time": "2014-07-30T22:32:58", "url": "https://files.pythonhosted.org/packages/33/4c/f8460999046e50c3222078d8903508ca62906b1002387a857fc94b32db41/py3-pmp-wrapper-0.3.0.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "f8a268ea077c7f828a8d2ecb89417cde", "sha256": "15b075901213af92de10c9148a2f0c99e7053f15d4aa4e213e2dfdc03db088e5" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.3.5.tar.gz", "has_sig": false, "md5_digest": "f8a268ea077c7f828a8d2ecb89417cde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26703, "upload_time": "2014-07-31T16:23:27", "url": "https://files.pythonhosted.org/packages/de/a6/63d4360253176c5563e3c19b0eed9d70aff0225f059ad76085abbd493926/py3-pmp-wrapper-0.3.5.tar.gz" } ], "0.3.8": [ { "comment_text": "", "digests": { "md5": "0f85b40e07232c5e24173763e228917d", "sha256": "112842ade17d4d061558a79bfb18351feb0deed51b7665ffb370e78a49d2b5da" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.3.8.tar.gz", "has_sig": false, "md5_digest": "0f85b40e07232c5e24173763e228917d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28053, "upload_time": "2014-07-31T23:00:43", "url": "https://files.pythonhosted.org/packages/05/1a/6254ffc445ef72a7168f4d00e9225c015c3b7497c0614e8e9ca74b3d3c71/py3-pmp-wrapper-0.3.8.tar.gz" } ], "0.3.9": [ { "comment_text": "", "digests": { "md5": "4f1c2f07dbeeb0309307fd37b364de03", "sha256": "9e7bf1b3366a437f4ce0efbb5cd15c9bcd48e125169102323a15b8d756b613de" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.3.9.tar.gz", "has_sig": false, "md5_digest": "4f1c2f07dbeeb0309307fd37b364de03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28058, "upload_time": "2014-07-31T23:02:17", "url": "https://files.pythonhosted.org/packages/ac/f6/bf0e345dfc8e06046f4fe8e8d6ee15c5820a12ec29f9b6c9bf566da03f4d/py3-pmp-wrapper-0.3.9.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "459a80548e2bd0ff517e5bd80e6f3111", "sha256": "e525109a68dcd0d3034319b8d1d854017073f24486e00edd04ee9effe4473237" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.4.0.tar.gz", "has_sig": false, "md5_digest": "459a80548e2bd0ff517e5bd80e6f3111", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28087, "upload_time": "2014-07-31T23:06:00", "url": "https://files.pythonhosted.org/packages/96/3e/e4f015aed9696b0e185d8ef1360ae0c03494658a44ec5d644b06822af7b5/py3-pmp-wrapper-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "16b9352aa3f6213dec75e04044683f2e", "sha256": "49001cbbc007f3c81299e9538f194550cc294e379f7f76f50e90381fd77ac327" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.4.1.tar.gz", "has_sig": false, "md5_digest": "16b9352aa3f6213dec75e04044683f2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28331, "upload_time": "2014-08-05T22:15:35", "url": "https://files.pythonhosted.org/packages/5d/97/31adf0d5d26dc013f3b6e8a8873bdec8872d8f30f8fdf7d4d50d304ca3eb/py3-pmp-wrapper-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "c1f5dab5cd6216752b809e0d758f2faf", "sha256": "b0431d9d045e0e991c3df5fc5907c090d09fd961513768026e2b99ee5043870a" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.4.2.tar.gz", "has_sig": false, "md5_digest": "c1f5dab5cd6216752b809e0d758f2faf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28434, "upload_time": "2014-08-05T23:33:01", "url": "https://files.pythonhosted.org/packages/1f/03/97020a00b24f7f4ba2a73e6d9b918fcd7f8583451b5dd4a82e9d527b7f50/py3-pmp-wrapper-0.4.2.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "117fc13b8f56ba969b1a37aeda5643ef", "sha256": "4380cab08e1d637b52ca35a98234872a2aa956a26f1d34e8b01c209806b408c2" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.4.4.tar.gz", "has_sig": false, "md5_digest": "117fc13b8f56ba969b1a37aeda5643ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29912, "upload_time": "2014-08-07T18:23:16", "url": "https://files.pythonhosted.org/packages/ed/ce/1a4fc21827030f93d321c9473117ea8a729ca6a6990f7402bf72e8713b01/py3-pmp-wrapper-0.4.4.tar.gz" } ], "0.4.8": [ { "comment_text": "", "digests": { "md5": "6f47c570bec3f07e69145da5b6b02539", "sha256": "184585dad33f7330cca1898b55309c7532eae5486fe4fcb6ec0dd2a700c4f2ca" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.4.8.tar.gz", "has_sig": false, "md5_digest": "6f47c570bec3f07e69145da5b6b02539", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35073, "upload_time": "2014-09-16T17:57:24", "url": "https://files.pythonhosted.org/packages/93/04/dd11741fb0512cb5819d528e8dfff175b473482e94801d69e0eaf569231a/py3-pmp-wrapper-0.4.8.tar.gz" } ], "0.4.9": [ { "comment_text": "", "digests": { "md5": "1e45c3595acdc016aaf90ff40daa4433", "sha256": "3e71dd30405ac4903e1694d903d6658635fdbe23c650a84b50c5105d8b675e0e" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.4.9.tar.gz", "has_sig": false, "md5_digest": "1e45c3595acdc016aaf90ff40daa4433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35143, "upload_time": "2014-09-16T17:59:55", "url": "https://files.pythonhosted.org/packages/4e/e0/bf3b8324decc402d52b52dfc8f83262b726b0cb651b12acd9813a0f4833c/py3-pmp-wrapper-0.4.9.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "4a9c611da05919f924bf7ffc687ba4fa", "sha256": "f724fddc98ea946d345d0dd6b7f132906d6e9e27f06141457fed15fed242e876" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.5.0.tar.gz", "has_sig": false, "md5_digest": "4a9c611da05919f924bf7ffc687ba4fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35470, "upload_time": "2014-09-17T23:46:02", "url": "https://files.pythonhosted.org/packages/c2/9e/867a5bd7730ffa8938975d4fbd5089450321f61d147a77726a2d1e9572e5/py3-pmp-wrapper-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4a9c611da05919f924bf7ffc687ba4fa", "sha256": "f724fddc98ea946d345d0dd6b7f132906d6e9e27f06141457fed15fed242e876" }, "downloads": -1, "filename": "py3-pmp-wrapper-0.5.0.tar.gz", "has_sig": false, "md5_digest": "4a9c611da05919f924bf7ffc687ba4fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35470, "upload_time": "2014-09-17T23:46:02", "url": "https://files.pythonhosted.org/packages/c2/9e/867a5bd7730ffa8938975d4fbd5089450321f61d147a77726a2d1e9572e5/py3-pmp-wrapper-0.5.0.tar.gz" } ] }