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.7.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.7.0
File Size Uploaded Provenance Actions
libfelix-1.7.0.tar.gz 16.7 kB Without provenance Details for libfelix-1.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 33.2 kB

Release files / libfelix-1.7.0.tar.gz

Download URL libfelix-1.7.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
db4e90471975b4a195eeacf132b895f338868d5d6171ddb88f048c1aed489753
BLAKE2b-256 checksum
How to use checksums
979628fd5a310b4caa173b06465bd88da29631058f4258d2f12858ee4dd145d7
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.7.0-py3-none-any.whl

Download URL libfelix-1.7.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ff807824c04fdef75ebd95345143070256db75f011744b90b98f07a67b275f8
BLAKE2b-256 checksum
How to use checksums
c7e3a2a1399551ea8930cf44eb79205f35089f6199073b203fd862d5a83b8e27
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.7.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