libfelix
Felix' library of snippets.
- few dependencies
- keep it simple
Installation
uv add libfelix
uv add libfelix[full]
libfelix.git
>>> from libfelix.git import Repo
>>> r = Repo('.')
>>> r.head
'9e260ece8558ba9a6c4ad6a9c89905630fe0140b'
libfelix.infra
pyinfra-related stuff.
from libfelix.infra import basics, provision
# ssh-keyscan -t ssh-ed25519 -H sdf.org
basics.ensure_known_host(
host_key=...,
)
basics.ssh_key_whitelist(
keys=[
'ssh-ed25519 ...',
]
)
provision.repo()
provision.felix_configs()
provision.docker()
basics.mise()
basics.fnox()
basics.mise_trust(dir_name=...)
See e2e-tests/deploy.py for details.
@tofu Connector
This also comes with a @tofu connector that is similar to the @terraform connector.
pyinfra @tofu/foo fact server.LinuxName
PYINFRA_TOFU_DIR=../another-state pyinfra @tofu/bar fact server.LinuxName
libfelix.music 1
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
from libfelix.logging import configure_structlog_console_from_env, get_logger
configure_structlog_console_from_env()
log = get_logger()
log.info('...')
libfelix.rename_scans 1
Renames scanned PDFs (from the M365 Android app and shared via KDE Connect) in a directory to a sane format.
felix-kdeconnect-rename-scans ~/Downloads/kdeconnect/
Development
mise trust
mise install
prek install -f
uv sync --all-extras
# to add a dependency to the optional-dependencies [full]
uv add --optional=full boto3
e2e-tests
https://developer.hashicorp.com/vagrant
vagrant plugin install vagrant-libvirt
vagrant up
pyinfra @vagrant
vagrant ssh-config > vagrant_ssh_config
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 libfelix-1.6.5.tar.gz.
File metadata
- Download URL: libfelix-1.6.5.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5004b411c6c9fb137ea921211e44671425635a3a895a83c81efc916e770caea1
|
|
| MD5 |
22a7190a1ff65c62eb5c55a921ad3f8a
|
|
| BLAKE2b-256 |
c655e6703673a5eeda72338e85a0d2169917b3b0b0edc4b96611c4aefd171d9d
|
File details
Details for the file libfelix-1.6.5-py3-none-any.whl.
File metadata
- Download URL: libfelix-1.6.5-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
750cb802238a7247517f923dc60f7346cc28525726c4fd37c1efba05bcef8883
|
|
| MD5 |
98d1a782c21424bcb316e6f5fe202654
|
|
| BLAKE2b-256 |
24b322ee94968a63f573b02c25008ee05218630b2c933b9eee34075f90b45630
|