{"id":17364321,"url":"https://github.com/arcward/martapy","last_synced_at":"2025-09-10T07:30:51.448Z","repository":{"id":193929033,"uuid":"73252643","full_name":"arcward/martapy","owner":"arcward","description":"Python wrapper for the MARTA Rail Realtime RESTful API","archived":false,"fork":false,"pushed_at":"2017-10-21T23:53:58.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-03T00:02:15.671Z","etag":null,"topics":["api","api-client","api-wrapper","marta","python","python-3","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arcward.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-09T04:37:10.000Z","updated_at":"2022-11-22T06:36:43.000Z","dependencies_parsed_at":"2023-09-10T20:41:00.405Z","dependency_job_id":null,"html_url":"https://github.com/arcward/martapy","commit_stats":null,"previous_names":["arcward/martapy"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcward%2Fmartapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcward%2Fmartapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcward%2Fmartapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcward%2Fmartapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arcward","download_url":"https://codeload.github.com/arcward/martapy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240850844,"owners_count":19867939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","api-wrapper","marta","python","python-3","python3"],"created_at":"2024-10-15T20:03:49.125Z","updated_at":"2025-02-26T12:25:36.890Z","avatar_url":"https://github.com/arcward.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=======\nMARTApy\n=======\nPython wrapper for MARTA realtime rail and bus APIs:\nhttp://www.itsmarta.com/app-developer-resources.aspx\n\n============\nInstallation\n============\nTo install via *pip*, just:\n\n.. code-block:: bash\n\n    $ pip install martapy\n\nOr, locally from the same directory as ``setup.py``:\n\n.. code-block:: bash\n\n    $ python setup.py install\n\n====\nRail\n====\nTo get a list of train arrivals:\n\n.. code-block:: python\n\n    from martapy import RailClient\n\n    rail_client = RailClient(api_key=\"your_api_key\")\n    arrivals = rail_client.arrivals()\n\nThis returns an instance of ``martapy.rail.Arrivals(list)`` which\nhas a few handy methods to filter results further.\n\nFor example, to print the destination and waiting time for upcoming\narrivals at *Peachtree Center Station*:\n\n.. code-block:: python\n\n    from martapy import RailClient\n\n    rail_client = RailClient(api_key=\"your_api_key\")\n    peachtree_station = rail_client.arrivals().by_station('peachtree')\n\n    for arrival in peachtree_station:\n        print(\"To: {}, When: {}\".format(arrival.destination, arrival.waiting_time))\n\nWith output that would look something like::\n    To: Airport, When: Arriving\n    To: Lindbergh, When: 16 min\n    To: Doraville, When: 19 min\n\nFilters\n-------\nTo narrow results, ``martapy.rail.Arrivals(list)`` has\na number of properties/methods:\n\n- Arrivals by **line**:\n  ``red_line``\n  ``blue_line``\n  ``green_line``\n  ``gold_line``\n- Arrivals by **direction**:\n  ``northbound``\n  ``eastbound``\n  ``westbound``\n  ``southbound``\n- Arrivals by **waiting time**:\n  ``boarding``\n  ``arriving``\n  ``arrived``\n- Arrivals grouped by **station name**:\n  ``Arrivals.stations``\n- Arrivals grouped by **train ID**:\n  ``Arrivals.trains``\n- Arrivals associated with a **specific station**:\n  ``Arrivals.by_station('station name')``\n\nThese can be chained as well for more specific results. For example, to\nget all arrivals for the red line which are heading southbound:\n\n.. code-block:: python\n\n    from martapy.rail import RailClient\n\n    rail_client = RailClient(api_key=\"your_api_key\")\n    arrivals = rail_client.arrivals().red_line.southbound\n\nOther properties\n----------------\nEach ``Arrivals`` instance returned is just a list of\n``martapy.rail.Arrival`` objects, with properties similar to the filters\nabove (*station, direction, event\\_time, line...*). To get the original\nJSON string back, use ``Arrival.json``.\n\n====\nBus\n====\nTo get a list of active buses:\n\n.. code-block:: python\n\n    from martapy import BusClient\n\n    bus_client = BusClient()\n    buses = bus_client.buses()\n\nTo get active buses for a particular route number, use\n``BusClient.buses(route=111)`` (or any other route number)\n\nTo filter this list down further, use ``filter()`` on the returned ``Buses``\nlist. For example, to return only *Westbound* buses:\n\n.. code-block:: python\n\n    from martapy import BusClient\n\n    bus_client = BusClient()\n    buses = bus_client.buses().filter(direction='Westbound')","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcward%2Fmartapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farcward%2Fmartapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcward%2Fmartapy/lists"}