https://github.com/openttd/py-helpers
Python libraries to support OpenTTD projects
https://github.com/openttd/py-helpers
Last synced: 11 days ago
JSON representation
Python libraries to support OpenTTD projects
- Host: GitHub
- URL: https://github.com/openttd/py-helpers
- Owner: OpenTTD
- License: lgpl-2.1
- Created: 2020-10-04T08:07:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T00:48:57.000Z (about 2 months ago)
- Last Synced: 2025-04-15T11:39:55.312Z (about 1 month ago)
- Language: Python
- Size: 45.9 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openttd-helpers
[](https://github.com/OpenTTD/py-helpers/blob/main/LICENSE)
A repository full of small bits of Python code, commonly used in other
projects developed for OpenTTD.To increase maintainability and to decrease code duplication, this repository
was created.# Usage
`pip install openttd-helpers`
See `examples/` folder for example use, or look into OpenTTD repositories containing Python code.
# Modules
## asyncio_helper
Helpers to make the user of `ayncio` easier.
- task: `enable_strong_referenced_tasks()` makes returned tasks from `ayncio.create_task` strong, so they are not garbage collected unexpectedly.
## click_helper
Helpers to make the use of `click` easier.
- command: by default, add `-h` to the allowed parameters.
- extend: allow extending a `click.command()` in other functions.
- import_module: used in combination with `Choice`, to auto-load modules based on the choice.## logging_helper
Setup a default logger via a `click.extend()` function.
## sentry_helper
Setup Sentry via a `click.extend()` function.