Skip to content

Python CLI for the library of Roubaix (Médiathèque Roubaix)

License

Notifications You must be signed in to change notification settings

tomsquest/mediathequeroubaix.py

Repository files navigation

MediathequeRoubaix.py

Python CLI for the library of Roubaix (Médiathèque Roubaix)

PyPI PyPI - Python Version


Releases: https://github.com/tomsquest/mediathequeroubaix.py/releases

Source Code: https://github.com/tomsquest/mediathequeroubaix.py

PyPI: https://pypi.org/project/mediathequeroubaix/


Table of Contents

Features

MédiathèqueRoubaix.py is a client for the libray of Roubaix, mediathequederoubaix.fr.

Screenshot 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:

pipx run mediathequederoubaix

With UV:

uvx mediathequederoubaix

If you want to install it globally:

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.

mediathequeroubaix config create

Screenshot CLI config create

Display the current configuration

config show displays the current configuration.

mediathequeroubaix config show

Screenshot CLI config show

List the loans

loans list show the list of loans for the users.

mediathequeroubaix loans list

Screenshot CLI loans list

Renew the loans

loans renew renew the list of loans for the users and display the new loans.

mediathequeroubaix loans renew

Screenshot CLI 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

Development

  • Clone this repository
  • Install UV
  • (Optional) if using direnv, create .envrc with:
uv sync
source .venv/bin/activate
  • Testing
pytest
  • Check everything in one go
pre-commit run --all-files

Releasing

  1. Commit, tag, publish using the release script:
./bin/release.py 1.2.3
  1. Update CHANGELOG.md
  2. Create a new release on GitHub

Credits