Metadata-Version: 2.4
Name: libfelix
Version: 1.2.1
Summary: Felix' library
Author-email: Felix Hummel <felix@felixhummel.de>
Project-URL: Repository, https://gitlab.com/felixhummel/libfelix/
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.2.1
Requires-Dist: cyclopts>=4.6.0
Requires-Dist: structlog>=25.1.0
Provides-Extra: full
Requires-Dist: dbus-python>=1.4.0; extra == "full"
Requires-Dist: icalendar>=6.3.2; extra == "full"
Requires-Dist: inotify>=0.2.12; extra == "full"
Requires-Dist: python-dateutil>=2.9.0.post0; extra == "full"
Dynamic: license-file

# libfelix
Felix' library of snippets.

- few dependencies
- keep it simple


## Installation
```
uv add libfelix
uv add libfelix[full]
```

[^full]: `libfelix[full]` is required for this feature


## libfelix.git
```python
>>> from libfelix.git import Repo
>>> r = Repo('.')
>>> r.head
'9e260ece8558ba9a6c4ad6a9c89905630fe0140b'
```


## libfelix.music [^full]
Controls music players via dbus (`org.mpris.MediaPlayer2.Player`) and scores them based on a simple heuristic (see
`score_players` in `libfelix/music/api.py`).
```
$ music --help
Usage: music [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  Next
  PlayPause
  Previous
  players
```


## libfelix.logging
Opinionated settings for Structlog:

- log to STDERR
- configure the log level by setting the environment variable `LOGLEVEL`

```python
from libfelix.logging import configure_structlog_console_from_env, get_logger

configure_structlog_console_from_env()
log = get_logger()
log.info('...')
```


## libfelix.rename_scans [^full]
Renames scanned PDFs (from the M365 Android app and shared via [KDE Connect](https://kdeconnect.kde.org/)) in a directory to a sane format.
```bash
felix-kdeconnect-rename-scans ~/Downloads/kdeconnect/
```


## Development
```
mise trust
mise install
prek install -f
uv sync --all-extras
```
