Skip to main content

Client to access the public transit service API endpoints.

Project description

Public Transit Client

Client to access the Public Transit Service API endpoints.

It is designed to interact seamlessly with the service, offering easy-to-use methods to query transit information and connections.

Installation

To install the package, you can use pip:

pip install public-transit-client

Usage

Here's a basic example of how to use the client:

from public_transit_client.client import PublicTransitClient

client = PublicTransitClient("http://localhost:8080")
response = client.get_stop("NANAA")
print(response)

See the integration tests for more examples.

Testing

This project uses pytest for both unit and integration testing. The tests are organized into separate folders to ensure clarity and separation of concerns.

Unit Tests

Unit tests are designed to test individual components in isolation. To run the unit tests, simply execute:

poetry run pytest -m unit

Integration Tests

Integration tests ensure that the components work together as expected in a more realistic environment. These tests require the service to be running, usually within a Docker container.

Step 1: Start the Docker Compose Environment

First, start the necessary services using Docker Compose:

docker compose up -d

Step 2: Run Integration Tests

Once the services are up and running, execute the integration tests with:

poetry run pytest -m integration

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

public_transit_client-0.1.1.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

public_transit_client-0.1.1-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page