tool_cta-python-api

CTA REST API Python Bindings

An in-progress project to map Chicago Transit Authority (CTA) REST APIs to Python classes

Table of Contents

About

This project provides CTA REST API bindings for Python. It was created as:

  1. A programming exercise,
  2. A useful library for CTA developers and students, and
  3. A way to experiment with data validation strategies

Features

Currently the following API endpoints are implemented:

Additionally, the data from each API endpoint is validated client side via JSON Schema. This is to ensure that:

  1. The data recieved is accurate to the documentation (as of 11/14/2024), and
  2. That in the event that an error due to a data dependency is to occur, users of the library can effectively trace back their problem to a specific API.

How To Install

You will need a valid CTA API key for this library to work. You can apply for one here.

Manual Installation

  1. git clone https://github.com/NicholasSynovic/tool_cta-python-api
  2. cd tool_cta-python-api
  3. make create-dev
  4. source env/bin/activate
  5. make build

This will install the library to the local virtual environment

Poetry

  1. poetry add "git+https://github.com/NicholasSynovic/tool_cta-python-api"@0.0.1

This will add the library to your local poetry project.

Documentation

API documentation is provided with this library.