rickle
- Python tools for working with configurations
rickle
is a versatile Python library and command-line tool offering a wide range of functionalities for working with YAML, JSON, TOML, INI, XML, and .ENV data.
Features
-
Serialization
Serialize Python objects to formats like YAML or JSON—ideal for converting data structures into human-readable configuration files. -
Schema Validation
Validate YAML/JSON/etc. against schemas to ensure structural consistency. -
Schema Generation
Automatically generate schemas from existing config files to formalize and document data structures. -
Conversion
Seamlessly convert between YAML, JSON, INI, XML, and .ENV formats to ease system interoperability. -
Simple Web Server
An experimental feature lets you define REST endpoints via YAML/JSON/etc. files—perfect for prototyping APIs or serving config data.
rickle
simplifies tasks like serialization, validation, generation, and conversion. It's especially valuable for developers and data engineers working with structured data.
Install
Optionall extras
Extra Python packages required by rickle
can be installed alongside (see Installation)
To install all extras:
Quick Start
Create a YAML file named config.yaml
:
conf:
db_connection:
acc_name:
type: env
load: ACC_NAME
default: developer_account
acc_pass:
type: env
load: ACC_PASS
database_name: public
Then use rickle
:
>>> from rickle import Rickle
>>> config = Rickle('./config.yaml')
>>> config.conf.db_connection.dict()
{'acc_name' : 'acceptance_account', 'acc_pass' : 'asd!424iXj', 'database_name' : 'public'}
>>> config.conf.db_connection.acc_pass
'asd!424iXj'
>>> config('/conf/db_connection/acc_pass')
'asd!424iXj'
See the Basic usage for more usage patterns. CLI details are available in the CLI section.
Changes and History
For full changelog, see Changelog.
Version 1.2.2 (2025-02-17):
- Project renamed from
rickled
torickle
- Fixed CLI execution bug
- Made
provider_access_key
optional forsecret
type
Coverage
For test coverage, see the coverage report.