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
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.
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
Built Distribution
File details
Details for the file public_transit_client-1.0.0.tar.gz
.
File metadata
- Download URL: public_transit_client-1.0.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2f081b756005d5118c79337a47a190e3aadc9b6d8682f208f27d38d7fd775b6 |
|
MD5 | bb61f087366c7e2383d48ccea8606ba4 |
|
BLAKE2b-256 | e59edc78f8182391c44edba6b246e6a5c7185c8d9a172e353e38609bb411f155 |
File details
Details for the file public_transit_client-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: public_transit_client-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db0c9651b45deda53d0bd10f0774a76c21799f6d36fb6fb9e95d1f6d8500ca83 |
|
MD5 | 0c2ec237ffd27f0380ae56bf456f7b5c |
|
BLAKE2b-256 | 80e74b0e7113ef656d4693cabac7bfaded755cefeea7101a164e18092abfee31 |