{ "info": { "author": "Michael Brown", "author_email": "brown.3.mike@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Internet :: WWW/HTTP" ], "description": "# WMATA Realtime Snapshot\n\n### Overview\n\nProvide a point-in-time mirror of Washington DC Metro's realtime train schedule\n\n### Installation\n\n1. **Install the package**\n\n ```shell\n pip install django-wmata-realtime-snapshot\n ```\n\n1. **Add the app to your django project's settings**\n\n ```python\n INSTALLED_APPS = (\n ...\n wmata_realtime_snapshot,\n )\n ```\n\n1. **Get a WMATA API key**\n\n If you don't already have a WMATA API account, sign up here: https://developer.wmata.com/signup\n\n Alternatively, you may have success using the demo key provided here: https://developer.wmata.com/Products\n\n Once you have a key, (e.g. `1234IAMAKEY`), you can use it to download a dump of the realtime data.\n\n1. **Download a JSON and/or XML dump from WMATA**\n\n These instructions are for a UNIX based system.\n\n JSON Dump:\n ```shell\n curl https://api.wmata.com/StationPrediction.svc/json/GetPrediction/All?api_key=1234IAMAKEY > realtime_dump.json\n ```\n\n XML Dump:\n ```shell\n curl https://api.wmata.com/StationPrediction.svc/GetPrediction/All?api_key=1234IAMAKEY > realtime_dump.xml\n ```\n\n To download both at the same time:\n\n ```shell\n curl https://api.wmata.com/StationPrediction.svc/json/GetPrediction/All?api_key=1234IAMAKEY > realtime_dump.json & curl https://api.wmata.com/StationPrediction.svc/GetPrediction/All?api_key=1234IAMAKEY > realtime_dump.xml\n ```\n\n1. **Add your dumps to the Django settings file**\n\n In your Django settings, define the following variables for the dumps you want to serve.\n\n ```\n WMATA_JSON_DUMP='path/to/realtime_dump.json'\n WMATA_XML_DUMP='path/to/realtime_dump.xml'\n ```\n\n Any endpoint type (json or xml) that does not have a dump file to read will return a json/xml error message when querying the snapshot API:\n\n ```json\n {\"Error\": \"No JSON resource has been defined. Please read the installation instructions.\"}\n ```\n\n ```xml\n No XML resource has been defined. Please read the installation instructions.\n ```\n\n1. **Add a url endpoint**\n\n ```python\n url(r'^mirror/', include('wmata_realtime_snapshot.urls', namespace='wmata_realtime_snapshot')),\n ```\n\n1. **Visit the API**\n\n The API path is the same as the real WMATA API for easy plug-n-play:\n\n ```\n http://localhost:8000/mirror/StationPrediction.svc/json/GetPrediction/All\n http://localhost:8000/mirror/StationPrediction.svc/GetPrediction/B01\n http://localhost:8000/mirror/StationPrediction.svc/json/GetPrediction/K08,D13,A05\n ```", "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/m3brown/django-wmata-realtime-snapshot", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-wmata-realtime-snapshot", "package_url": "https://pypi.org/project/django-wmata-realtime-snapshot/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-wmata-realtime-snapshot/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/m3brown/django-wmata-realtime-snapshot" }, "release_url": "https://pypi.org/project/django-wmata-realtime-snapshot/0.2/", "requires_dist": null, "requires_python": null, "summary": "A point-in-time mirror of Washington DC Metro's realtime train schedule", "version": "0.2" }, "last_serial": 1894324, "releases": { "0.1": [], "0.2": [ { "comment_text": "", "digests": { "md5": "a7402e3ea1796aee381e7b084c86c571", "sha256": "3961107bb0dfb0692eb66f7762ebc618e51d08c906ffde5e2665894127ae7469" }, "downloads": -1, "filename": "django-wmata-realtime-snapshot-0.2.tar.gz", "has_sig": false, "md5_digest": "a7402e3ea1796aee381e7b084c86c571", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3342, "upload_time": "2016-01-08T04:00:51", "url": "https://files.pythonhosted.org/packages/bf/f2/6d0fb087eaf90fabc14c6faab13a734c29fa94b44df9bc80df3074c36e58/django-wmata-realtime-snapshot-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a7402e3ea1796aee381e7b084c86c571", "sha256": "3961107bb0dfb0692eb66f7762ebc618e51d08c906ffde5e2665894127ae7469" }, "downloads": -1, "filename": "django-wmata-realtime-snapshot-0.2.tar.gz", "has_sig": false, "md5_digest": "a7402e3ea1796aee381e7b084c86c571", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3342, "upload_time": "2016-01-08T04:00:51", "url": "https://files.pythonhosted.org/packages/bf/f2/6d0fb087eaf90fabc14c6faab13a734c29fa94b44df9bc80df3074c36e58/django-wmata-realtime-snapshot-0.2.tar.gz" } ] }