About The Project
Overview
This package was created by factoring out many reusable code artifacts from my various projects over a number of years. Since this work was not a part of a group effort, the test coverage is predictably abysmal :raised_eyebrow: and Python documentation notably absent :expressionless:. For each of my projects, which derive from a common Docker application found here, this package provides some specific and relatively powerful features to enable rapid offshoots for new ideas.
The package is organized under src/tailucas_pylib/ with the following key modules:
-
Core Modules:
__init__.py: Application bootstrap with logging, locale, configuration (viaapp.conf), and device name setup. Logs to syslog (UDP) or stdout/stderr. Optionally changes working directory toWORK_DIR.creds.py: 1Password credential management supporting both 1Password Connect Server and 1Password Service Account modes. Fetches secrets from environment variables or container secrets (/run/secrets).flags.py: Feature flag checking backed by a 1Password credential item.
-
Application Framework:
app.py: Thread base class with ZMQ relay (ZmqRelay) and worker (ZmqWorker) patterns for inter-thread communication via ZeroMQ.threads.py: Thread nanny with shutdown tracking, graceful termination, Cronitor monitoring integration, and lingering socket cleanup.handler.py: Context manager (exception_handler) that handles ZMQ connectivity,ContextTerminated,ResourceWarning, and general exceptions with optional Sentry reporting and graceful shutdown.process.py: Signal handler (SignalHandler) with subprocess execution (exec_cmd) helpers.
-
Communication:
-
Utilities:
data.py: Builds MessagePack payloads with timestamp and optional data for IPC.datetime.py: Timezone-aware timestamp creation, ISO formatting, and Unix timestamp conversion.device.py: Pydantic data model (Device) for device state with optional fields.bluetooth.py: Bluetooth adaptor detection and device ping viahcitool/l2ping.
-
AWS Integration (
aws/):__init__.py: Manages cached Boto3 sessions with STS role assumption, credential retrieval from 1Password.metrics.py: Posts CloudWatch count metrics with dimensions.
-
Command-line Tools (
tools/):config_interpol.py: Interpolates a config file with environment variables or an overlay config, outputting the resolved values.cred_tool.py: Fetches and displays a 1Password credential read from stdin.yaml_interpol.py: Processes YAML templates, substituting values from configuration sections.aws_configure.py: Generates AWS CLI configuration files from 1Password-stored credentials.
Built With
Technologies that help make this package useful:
Also:
Core Technologies:
- Python 3.8+ - Primary runtime
- 1Password Connect/Service Account - Credential management
- ZeroMQ - Inter-process communication
- RabbitMQ - Message queuing
- MessagePack - Binary serialization
- Pydantic - Data validation and modeling
- Sentry - Error tracking and monitoring
AWS Integration:
- Boto3 - AWS SDK
- CloudWatch - Metrics and monitoring
- Simple Workflow Service - Workflow orchestration (deprecated)
Development Tools:
- uv - Dependency management
- Cronitor - Cron job monitoring
Getting Started
Here is some detail about the intended use of this package.
Prerequisites
A Python project or runtime environment. Since this project is already initialized with [uv][vu-url] dependency management, I recommend that you continue to use it. Beyond the Python dependencies defined in the configuration, the package init carries hardcoded dependencies on Sentry and 1Password in order to function. Unless you want these and are effectively extending my base project, you're likely better off forking this package and cutting out what you do not need.
Installation
This package is published to the Python Package index from time to time.
Usage
I have various projects that use this tool chain. For example, my Base Project which can be run stand-alone but also serves as my Docker base image from which other projects are derived.
License
Distributed under the MIT License. See LICENSE for more information.
Acknowledgments
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 tailucas_pylib-0.7.2.tar.gz.
File metadata
- Download URL: tailucas_pylib-0.7.2.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71b521a372faeebf03bf13b951ea039b776a19509b260d9536fda7d6b73c81c5
|
|
| MD5 |
bb94474ac18365ff2a1e8b1f4a67349e
|
|
| BLAKE2b-256 |
db44d2d256c92d05c2313501b48c2e5f772748bba634fac537239048ff40305a
|
File details
Details for the file tailucas_pylib-0.7.2-py3-none-any.whl.
File metadata
- Download URL: tailucas_pylib-0.7.2-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81b74dc23923caae04e2acec29e859c416ef04c35601454f763db8f786c5bb90
|
|
| MD5 |
07bd96e667932196dd89307620e2972b
|
|
| BLAKE2b-256 |
00e3cf7047906dc7df7393225118ad75bf69000b9b29f85ce074a781560c1661
|