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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libfelix-1.6.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libfelix-1.6.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file libfelix-1.6.2.tar.gz.

File metadata

  • Download URL: libfelix-1.6.2.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

Hashes for libfelix-1.6.2.tar.gz
Algorithm Hash digest
SHA256 f634595b85db1686b8ce67b1c7589977b40fd1989aea6bb45cf20e377ba95e6f
MD5 e31216288a4ecb8228ed7661bded5a70
BLAKE2b-256 8550601e0e46fcf7a7ce7291d60bdc0d9dfe48d6445fafa76afc169395f42fb8

See more details on using hashes here.

File details

Details for the file libfelix-1.6.2-py3-none-any.whl.

File metadata

  • Download URL: libfelix-1.6.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for libfelix-1.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff93223bb81ad5f0d0cd31a477b6322b8e7657964321e3be6f1dfdbeb4da712
MD5 b4dcf4fecb65e98e08fbcb3c3fa75226
BLAKE2b-256 05f2583b72a1fb51de9acb787cfde97fbcb173aba2a920361d6e9ca1e17d3b9e

See more details on using hashes here.

Release history Release notifications | RSS feed

1.6.5

2 files

1.6.4

2 files

1.6.3

2 files

This release

1.6.2 This release

2 files

1.6.1

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

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