Registry / observability / daiquiri

daiquiri

JSON →
library3.4.0pypypi✓ verified 85d ago

Daiquiri is a Python library designed to simplify the configuration of Python's built-in `logging` module. It provides an easy-to-use interface for setting up basic logging functionalities, including custom formatters and handlers, often with a single call to `daiquiri.setup()`. The library is actively maintained, with its current version being 3.4.0, and has a consistent update cadence.

pip install daiquiri
INSTALL
IMPORT
SIG · DAIQUIRI
D
daiquiri
observabilitypythonv3.4.0
Install
1.6s avg
Import
123ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.128s · 18.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.119s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

setup
from daiquiri import setup
import daiquiri; daiquiri.setup(...)
getLogger
from daiquiri import getLogger
parse_and_set_default_log_levels
from daiquiri import parse_and_set_default_log_levels

This quickstart demonstrates how to initialize Daiquiri for basic logging to `stderr` with colored output. It also shows how to obtain a logger instance and log messages at different levels, including custom keyword arguments which Daiquiri supports natively. An commented-out example for JSON file logging is also provided, highlighting the need for an additional dependency.

import logging import daiquiri # Basic setup to log to stderr with colors daiquiri.setup(level=logging.INFO) # Get a logger instance logger = daiquiri.getLogger(__name__) logger.info('This is an info message.') logger.warning('This is a warning message.') logger.error('This is an error message with extra context!', user_id='123', transaction_id='abc') # Example with JSON output to a file (requires 'pip install python-json-logger') # from daiquiri.output import File # from daiquiri.formatter import JSON_FORMATTER # daiquiri.setup( # level=logging.INFO, # outputs=( # File('app.log', formatter=JSON_FORMATTER), # ) # ) # logger_json = daiquiri.getLogger('json_example') # logger_json.info('JSON message', data={'key': 'value'})
Debug
Known issues
gotchaDaiquiri by default overrides Python's standard `warnings` module behavior, routing warnings to the `py.warnings` logger. If you rely on default `warnings` module behavior or custom warning filters, this might affect your application.
fix
To disable this, pass `capture_warnings=False` to `daiquiri.setup()`: `daiquiri.setup(capture_warnings=False)`.
affects: All versions 2.x and 3.x
gotchaWhile standard `logging.getLogger()` works, `daiquiri.getLogger()` is recommended. It provides an enhanced logger object that allows passing arbitrary keyword arguments to logging methods, which are then included as part of the log record. This enables rich, structured logging without extra boilerplate.
fix
Always retrieve loggers using `logger = daiquiri.getLogger(__name__)` to leverage all of Daiquiri's features.
affects: All versions 2.x and 3.x
gotchaFor structured JSON logging using `daiquiri.formatter.JSON_FORMATTER`, the `python-json-logger` library is a required dependency and must be installed separately.
fix
Ensure `pip install python-json-logger` is run if you intend to use JSON formatting.
affects: All versions 2.x and 3.x
Upgrade
Version history
3.4.0latest on PyPI · released Sep 4, 2025
Audit
Dependencies
python-json-loggeroptionalRequired for using the JSON log formatter (daiquiri.formatter.JSON_FORMATTER).
Agent activity
21 hits · last 30 days
node
20
OpenAI (training)
1
Resources
daiquiri — pip install daiquiri · libregistry