Dev Utils
A collection of development utilities, starting with structured logging.
Installation
pip install dev-utils-jokerssd
Logging Utils
A powerful wrapper around structlog and Python's standard logging module to provide structured JSON logging with rotation, async writing, and easy configuration.
Usage
from dev_utils import LoggingUtils
# Basic Setup
logging_utils = LoggingUtils(
log_file="app.log",
log_level="INFO",
print_output=True,
json_formatter=True,
binding_dict={"app_name": "my_app"}
)
logger = logging_utils.get_logger()
# Log something
logger.info("Application started", version="1.0.0")
# Exception logging
try:
1 / 0
except ZeroDivisionError:
logger.exception("Something went wrong")
Features
- Structured JSON Logs: By default, logs are formatted as JSON for easy parsing by log management tools.
- Async Logging: Uses a background thread for file writing to avoid blocking the main execution path.
- Log Rotation: Automatically rotates log files daily (default).
- Context Binding: Bind global context variables (like
request_idoruser_id) to all logs. - Standard API: Compatible with standard python
logging(mostly) andstructlog.
Lark Wrapper
A wrapper for interaction with Lark/Feishu Custom bots, providing strong typing and error handling.
Usage
from dev_utils.lark_wrapper import MsgBot, BotType, MsgType, BotStatus
# Initialize the bot
bot = MsgBot(
chat_id="your-chat-id",
url="https://open.larksuite.com/open-apis",
api_name="bot/v2/hook/",
bot_type=BotType.LARK
)
# Send a text message
response = bot.send_cust_bot_msg(
message="Hello, World!",
msg_type=MsgType.TEXT,
title="Notification"
)
# Check response
if response.status == BotStatus.OK:
print("Success:", response.msg)
else:
print("Failed:", response.errors)
Features
- Strong Typing: Uses
BotStatus,BotType, andBotResponsefor predictable API interactions. - Multi-Platform Support: Extensible design (currently supports Lark).
- Async Support:
async_send_msgavailable for non-blocking operations. - Rich Content: Supports Post/Rich Text messages via
MsgType.POST.
Metadata
Release files for dev-utils-jokerssd 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dev_utils_jokerssd-0.5.2.tar.gz | 75.0 kB | Without provenance | Details for dev_utils_jokerssd-0.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dev_utils_jokerssd-0.5.2-py3-none-any.whl | Python 3 | none | any | Details for dev_utils_jokerssd-0.5.2-py3-none-any.whl |
Total release size: 91.1 kB
Release files / dev_utils_jokerssd-0.5.2.tar.gz
| Download URL | dev_utils_jokerssd-0.5.2.tar.gz |
|---|---|
| Size | 75.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9721a7c594a5c969a6ac0675b73a086dc8ee66fe96877eb42e090f1ea6107529
|
|
BLAKE2b-256 checksum How to use checksums |
1e6e2d3a9befd662f3d4caa96f6ef2d124702141f6c7106734ef0e912790dad9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Release files / dev_utils_jokerssd-0.5.2-py3-none-any.whl
| Download URL | dev_utils_jokerssd-0.5.2-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3142868570a0e2abb9744e3f175629efe48038262396d0115d10378e66667fb5
|
|
BLAKE2b-256 checksum How to use checksums |
342709c90488ec703cc1fa77aa07d239fbc69751c57e4fc9dffdaf0dc0ec9127
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Security for dev-utils-jokerssd 0.5.2
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.