https://github.com/tomsquest/mediathequeroubaix.py
Python CLI for the library of Roubaix (Médiathèque Roubaix)
https://github.com/tomsquest/mediathequeroubaix.py
functional-programming
Last synced: 6 months ago
JSON representation
Python CLI for the library of Roubaix (Médiathèque Roubaix)
- Host: GitHub
- URL: https://github.com/tomsquest/mediathequeroubaix.py
- Owner: tomsquest
- License: mit
- Created: 2022-10-04T15:28:17.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-04T05:43:53.000Z (about 1 year ago)
- Last Synced: 2025-05-20T09:08:07.623Z (7 months ago)
- Topics: functional-programming
- Language: Python
- Homepage:
- Size: 1.83 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Python CLI for the library of Roubaix (Médiathèque Roubaix)
[](https://pypi.python.org/pypi/mediathequeroubaix/)
[](https://pypi.python.org/pypi/mediathequeroubaix/)
---
**Releases**: [https://github.com/tomsquest/mediathequeroubaix.py/releases](https://github.com/tomsquest/mediathequeroubaix.py/releases)
**Source Code**: [https://github.com/tomsquest/mediathequeroubaix.py](https://github.com/tomsquest/mediathequeroubaix.py)
**PyPI**: [https://pypi.org/project/mediathequeroubaix/](https://pypi.org/project/mediathequeroubaix/)
---
## Table of Contents
- [Features](#features)
- [Display your loans](#display-your-loans)
- [Renew your loans](#renew-your-loans)
- [Usage](#usage)
- [Running](#running)
- [Create an initial, sample configuration](#create-an-initial-sample-configuration)
- [Display the current configuration](#display-the-current-configuration)
- [List the loans](#list-the-loans)
- [Renew the loans](#renew-the-loans)
- [Why I am doing this](#why-i-am-doing-this)
- [Changelog](#changelog)
- [Development](#development)
- [Releasing](#releasing)
- [Credits](#credits)
## Features
MédiathèqueRoubaix.py is a client for the **libray of Roubaix**, [mediathequederoubaix.fr](http://www.mediathequederoubaix.fr/).
### Display your loans
Running `mediathequeroubaix loans list` will:
1. Get the **list of your loans** and their due date
2. ...for **many cardholders**
3. and check the **next return date** for each of your card
### Renew your loans
Running `mediathequeroubaix loans renew` will:
1. Renew **automatically** all loans
2. ...for **many cardholders**
3. and print the **new due date** of the loans
## Usage
### Running
With Pipx:
```shell
pipx run mediathequederoubaix
```
With UV:
```shell
uvx mediathequederoubaix
```
If you want to install it globally:
```shell
pipx install mediathequeroubaix
```
### Create an initial, sample configuration
`config create` makes a sample configuration in `$HOME/.config/mediathequederoubaix/config.json` and display the content of the file.
The configuration is initialized with a sample but fake user.
```shell
mediathequeroubaix config create
```
### Display the current configuration
`config show` displays the current configuration.
```shell
mediathequeroubaix config show
```
### List the loans
`loans list` show the list of loans for the users.
```shell
mediathequeroubaix loans list
```
### Renew the loans
`loans renew` renew the list of loans for the users and display the new loans.
```shell
mediathequeroubaix loans renew
```
## Why I am doing this
I created this project to:
1. Learn **Functional Programing**
2. Learn **typed** and **modern** Python
3. Be able to quickly list and renew my loans (especially when you have many cards)
## Changelog
See [CHANGELOG.md](CHANGELOG.md)
## Development
* Clone this repository
* Install [UV](https://docs.astral.sh/uv/)
* (Optional) if using direnv, create .envrc with:
```
uv sync
source .venv/bin/activate
```
* Testing
```sh
pytest
```
* Check everything in one go
```sh
pre-commit run --all-files
```
### Releasing
1. Commit, tag, publish using the release script:
```shell
./bin/release.py 1.2.3
```
2. Update `CHANGELOG.md`
3. Create a new release on GitHub
## Credits
- Background and color from [PrettySnap](https://prettysnap.app/)
- Python project bootstrapped using [Wolt template](https://github.com/woltapp/wolt-python-package-cookiecutter)
- Functional library is [Returns from DRY-Python](https://github.com/dry-python/returns)
- Tables look great thanks to [Textualize's Rich](https://github.com/Textualize/rich)
- CLI screenshot pimped with [ShowCode.app](https://showcode.app)