Python client for the AELF API (https://api.aelf.org/)
Project description
aelf-api-client
An unofficial Python client for interacting with the AELF API. This library provides an easy-to-use interface for fetching liturgical information from the AELF API.
Table of contents
Features
- Fetch liturgical information for a specific date and zone.
- Retrieve liturgical entities (
masses,complines,lauds,readings,none,sext,terceorvespers) for a specific date and zone. - Built with
aiohttpfor asynchronous requests. - Validates API responses using
pydanticmodels.
Installation
Package is directly available from the Pypi repositories:
pip install aelf-api-client
Usage
Example: Fetch masses informations
from datetime import datetime
import asyncio
from aelf_api_client import AELFClient
from aelf_api_client.schemas.enums import ZoneEnum, EntityEnum
from aelf_api_client.schemas.responses import MassesResponseModel
async def main():
client = AELFClient()
date = datetime.now()
zone = ZoneEnum.FRANCE
masses: MassesResponseModel
# 2 ways to fetch a liturgical entity:
masses = await client.request_masses(date=date, zone=zone)
# or
masses = await client.request(entity=EntityEnum.MASS, date=date, zone=zone)
print(masses)
asyncio.run(main())
Available Methods:
The AELFClient provides the following methods:
request(entity: EntityEnum, date: datetime, zone: ZonesEnum): Fetch any liturgical entity for a given day and zonerequest_informations(date: datetime, zone: ZonesEnum): Fetch informations for a given day and zonerequest_masses(date: datetime, zone: ZonesEnum): Fetch masses for a given day and zonerequest_complines(date: datetime, zone: ZonesEnum): Fetch comlines for a given day and zonerequest_lauds(date: datetime, zone: ZonesEnum): Fetch lauds for a given day and zonerequest_readings(date: datetime, zone: ZonesEnum): Fetch readings for a given day and zonerequest_none(date: datetime, zone: ZonesEnum): Fetch none for a given day and zonerequest_sext(date: datetime, zone: ZonesEnum): Fetch sext for a given day and zonerequest_terce(date: datetime, zone: ZonesEnum): Fetch terce for a given day and zonerequest_vespers(date: datetime, zone: ZonesEnum): Fetch vespers for a given day and zone
Each method fetches data for a specific liturgical entity and returns a validated Pydantic response model.
Development
Setting Up the Local Environment
git clone git@github.com:thamin-i/aelf-api-client.git
cd aef-client
make install
Running Tests
Tests are written using pytest. To run the tests:
poetry run pytest
Code Formatting and Linting
This project uses ruff, isort, and pylint for formatting and linting. To check the code:
make format_code && make check_code
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Write tests for your changes.
- Run the tests to ensure everything works.
- Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
- Pypi: Project
- Homepage: AELF Python Client
- Issues: https://github.com/thamin-i/aelf-api-client/issues
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aelf_api_client-1.3.3.tar.gz.
File metadata
- Download URL: aelf_api_client-1.3.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe9789017fbd6bfedebeba578c2c24cf2e315cfe8afd64459bfb52ed71e8c410
|
|
| MD5 |
4ca4c88b9caf8dc76d5168285edbb720
|
|
| BLAKE2b-256 |
788b698bb0ef6115a7340289836369481cff7f22d364c10b344b95f4cb70fff6
|
File details
Details for the file aelf_api_client-1.3.3-py3-none-any.whl.
File metadata
- Download URL: aelf_api_client-1.3.3-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c968db1c793d12003a7566be371881f9bc6707e56a3fc154cdb010ef8ea2908
|
|
| MD5 |
1a996f357385ca590f1d23e5835dd88d
|
|
| BLAKE2b-256 |
f986066625d8db17c6b6bf5dc4a9d90599f8184a66e328f02c058622d6328456
|