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.8.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.8.0
File Size Uploaded Provenance Actions
libfelix-1.8.0.tar.gz 17.3 kB Without provenance Details for libfelix-1.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 34.4 kB

Release files / libfelix-1.8.0.tar.gz

Download URL libfelix-1.8.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
97dd52dd39440331a523d236bc7fb61a05eae1fbc4e0e0a1f4a2836e104d84bd
BLAKE2b-256 checksum
How to use checksums
df4bf923c622d0aa3c3a38febb48dd4464d23cbca52951ed92436dae84537002
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.8.0-py3-none-any.whl

Download URL libfelix-1.8.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8387f6c1d2ba5f23c08c3b279c4d919eb11e9e466354efa78db628e3b933e5b
BLAKE2b-256 checksum
How to use checksums
e29c846ccf817a829dac23dd569004995c9336700e677973e7e8204fbdc3c0d5
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.8.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