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
Coverage
To analyze the test coverage run:
poetry run pytest --cov=public_transit_client
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for public-transit-client 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| public_transit_client-1.0.1.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| public_transit_client-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / public_transit_client-1.0.1.tar.gz
| Download URL | public_transit_client-1.0.1.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74e70b5f8390dcf887bf64a950acbf46a36ce9bf019c870734d06d8c4db4d2ea
|
|
BLAKE2b-256 checksum How to use checksums |
6c9c4f1aecdf1c4530d5f5523d743f55ad05fa71364aec6cdf706f5f4567259d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
|
Release files / public_transit_client-1.0.1-py3-none-any.whl
| Download URL | public_transit_client-1.0.1-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
afdb3511c2d5c29adc79c1ba35bfd01f7ef69dcad33078480679e2ca3256821e
|
|
BLAKE2b-256 checksum How to use checksums |
ad5981ea1eb6721248971f0c53ed6d2ba2a19115886e494634ea8941d16c1dd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
|