Asynchronous Python client for the Garages Amsterdam
Project description
Python - Garages Amsterdam Client
Asynchronous Python client for the garage occupancy in Amsterdam (The Netherlands).
About
A python package with which you can read the occupancy of a parking garage in Amsterdam (The Netherlands). Both for day visitors (short-term parking) and season ticket holders (long-term parking).
NOTE: Not all parking garages have data for long-term parking.
Installation
pip install garages-amsterdam
Usage
import asyncio
from garages_amsterdam import GaragesAmsterdam
async def main():
"""Show example on using the Garage Amsterdam API client."""
async with GaragesAmsterdam() as client:
all_garages: list[Garage] = await client.all_garages()
garage: Garage = await client.garage(garage_id="ID_OF_GARAGE")
print(all_garages)
print(garage)
if __name__ == "__main__":
asyncio.run(main())
Data
You can read the following data with this package:
- Name of the parking garage
- API State (
ok
orproblem
) - Free space short
- Free space long
- Short capacity
- Long capacity
- Availability percentage (based on short capacity)
- Longitude
- Latitude
Contributing
This is an active open-source project. We are always open to people who want to use the code or contribute to it.
We've set up a separate document for our contribution guidelines.
Thank you for being involved! :heart_eyes:
Setting up development environment
This Python project is fully managed using the Poetry dependency manager.
You need at least:
- Python 3.9+
- Poetry
Install all packages, including all development requirements:
poetry install
Poetry creates by default an virtual environment where it installs all necessary pip packages, to enter or exit the venv run the following commands:
poetry shell
exit
Setup the pre-commit check, you must run this inside the virtual environment:
pre-commit install
Now you're all set to get started!
As this repository uses the pre-commit framework, all changes are linted and tested with each commit. You can run all checks and tests manually, using the following command:
poetry run pre-commit run --all-files
To run just the Python tests:
poetry run pytest
License
MIT License
Copyright (c) 2020-2022 Klaas Schoute
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
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 garages-amsterdam-4.1.0.tar.gz
.
File metadata
- Download URL: garages-amsterdam-4.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.9.13 Linux/5.13.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cf9df1f7d5bfe3a628291597c02db25356b69faeee352e5ffb3fc0fb7fec469 |
|
MD5 | ea0fd4a6198c307f5892e54f4c490ac2 |
|
BLAKE2b-256 | 3175125f9d8da36dbc3948363dcbe6ff5396bebf63bb5b7f5fe16bd6f802843f |
File details
Details for the file garages_amsterdam-4.1.0-py3-none-any.whl
.
File metadata
- Download URL: garages_amsterdam-4.1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.9.13 Linux/5.13.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36d2fd63833a219dfbba97d6ac3523cef175a274cb29f07574085cc7b835e2c |
|
MD5 | dcaba5758b78b84d57e2e7a9a40cf202 |
|
BLAKE2b-256 | 4d906efb69ac361e8f87e6f909a1bd44bbdf5ef70dce48252ed930ec65d2053f |