Add your description here
Project description
Skirk
A lightweight configuration management library that supports loading configurations from multiple sources with type conversion and validation.
Features
- Multi-source Configuration Loading: Load configurations from files, command-line arguments, and other sources
- Type Safety: Provide type conversion and validation to ensure configuration values match expected types
- Flexible Extension: Customize configuration sources, parsers, and type factories
- Dataclass Integration: Based on Python dataclasses for simple and intuitive usage
- Multiple Format Support: Built-in YAML and JSON parsers
Installation
Install with pip:
pip install skirk
Or install with uv:
uv add skirk
Quick Start
from dataclasses import dataclass
from pathlib import Path
from skirk import BaseConfig, FileSource
@dataclass
class AppConfig(BaseConfig):
host: str
port: int
debug: bool = False
# Load configuration from file
config = AppConfig.from_file("config.yaml")
print(config.host)
print(config.port)
print(config.debug)
Custom Config Parser
from skirk import config_parser, BaseConfigParser
@config_parser(suffix="custom")
class CustomParser(BaseConfigParser):
@classmethod
def parse(cls, f):
...
@classmethod
def dump(cls, f):
# support for dump config to custom format config file
...
Custom Type Support
from skirk import type_factory
from datetime import datetime
@type_factory
def datetime_factory(value: str) -> datetime:
return datetime.fromisoformat(value)
class DateConfig(BaseConfig):
launch_date: datetime
Contact
For any questions or suggestions, please contact kujou-kazuya@outlook.com
© 2025 Kujou Kazuya
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
skirk-0.1.0.tar.gz
(10.4 kB
view details)
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
skirk-0.1.0-py3-none-any.whl
(9.6 kB
view details)
File details
Details for the file skirk-0.1.0.tar.gz.
File metadata
- Download URL: skirk-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c77359c7efeb143f2ce6264cc43287a2bf2736d774145c474ba1d0b66e55e36
|
|
| MD5 |
f5e959ff9cc4bed94b0649abf5763e6a
|
|
| BLAKE2b-256 |
12e58146b0044c19c7eba5c295e6b9a22c7ed3e3d5618237395997a589139589
|
File details
Details for the file skirk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: skirk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4abd33151d2d19fbea0d82d28c32373f13c5a658965746251db75bd5a1283994
|
|
| MD5 |
d1933601081865ca097a765e397d2b25
|
|
| BLAKE2b-256 |
c56e7b3990a221e9bd96d70bd9fe97c8d3035207cedb5427ac89f42eb1860182
|