Skip to main content

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
  1. libfelix[full] is required for this feature ↩ ↩2

Metadata

Release files for libfelix 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libfelix 1.9.0
File Size Uploaded Provenance Actions
libfelix-1.9.0.tar.gz 17.3 kB Without provenance Details for libfelix-1.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for libfelix 1.9.0
File Interpreter ABI Platform Actions
libfelix-1.9.0-py3-none-any.whl Python 3 none any Details for libfelix-1.9.0-py3-none-any.whl

Total release size: 34.8 kB

Release files / libfelix-1.9.0.tar.gz

Download URL libfelix-1.9.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cd77be96423ad8d42999473952cf920691892f7b58fbc09d548e649a094fb4ab
BLAKE2b-256 checksum
How to use checksums
04ef392e35f1113e94abfb0649cd2ae393eced59db6879f46a3386ccca178963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / libfelix-1.9.0-py3-none-any.whl

Download URL libfelix-1.9.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8a80bcffa04e4e8d6cf0ce32b50b415c560af74a899c044f33286ce94e1d12a
BLAKE2b-256 checksum
How to use checksums
691e4e8bbe4b5af3a2e647c40818f5652259cedb98836934ff1377659aae156b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for libfelix 1.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page