Skip to main content

Tools for pickling Python objects in a completely different way

Project description

rickle - Smart Python tools for working with YAML

██████╗ ██╗ ██████╗██╗  ██╗██╗     ███████╗
██╔══██╗██║██╔════╝██║ ██╔╝██║     ██╔════╝
██████╔╝██║██║     █████╔╝ ██║     █████╗  
██╔══██╗██║██║     ██╔═██╗ ██║     ██╔══╝  
██║  ██║██║╚██████╗██║  ██╗███████╗███████╗
╚═╝  ╚═╝╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚══════╝
by Zipfian Science                               

rickle is a versatile Python library and command-line tool that offers a wide range of functionalities for working with YAML and JSON data. Here's a brief summary of its key features:

  1. Serialization: rickle allows you to easily serialize Python objects to YAML format. This is particularly useful for converting Python data structures into a human-readable and easily shareable format.

  2. Schema Validation: It provides the capability to validate YAML and JSON data against predefined schemas. This ensures that your data adheres to a specific structure or format, helping to maintain data consistency.

  3. Schema Generation: You can generate schema definitions from existing YAML (or JSON) files. This is helpful when you want to formalize the structure of your data or for documentation purposes.

  4. Conversion between YAML and JSON: rickle offers seamless conversion between YAML and JSON formats. This facilitates data interchange between systems that use different serialization formats.

  5. Simple Web Server: One unique feature of rickle is its ability to create a basic web server from a YAML file. This means you can define endpoints, routes, and data sources purely by writing it as a YAML file, making it easy to prototype web services without extensive coding, or to create mock REST APIs.

In summary, rickle is a powerful utility for working with YAML and JSON data in Python. It simplifies tasks like serialization, schema validation, schema generation, format conversion, and even enables quick web server prototyping using YAML configuration files. This tool is valuable for developers and data engineers working with structured data in a flexible and efficient manner.

For documentation, see docs.

Source on GitHub.


$ pip install rickled

And use

from rickled import Rickle

Using an example YAML file:

  text: test
    one: 1
    two: 2
  number: 2
    - one
    - two
    - four
    - name: John
      age: 20
    type: env
    load: USERNAME
    type: lambda
    load: "lambda: print('hell world!')"
    type: lambda
      - "from datetime import datetime as dd"
    load: "lambda: print(dd.utcnow().strftime('%Y-%m-%d'))"
    type: function
    name: test_function
      x: 7
      y: null
      s: hello world
        - 1
        - hello
      - "math"
    load: >
      def test(x, y, s, any):
        iii = 111
        if y:
        for i in any:

Then use Rickle:

>> from rickled import Rickle

>> config = Rickle('./config.yaml', deep=True, load_lambda=True)

>> config.BASIC.callable_lambda()
'hell world!'


See the version history in changelog.

  • Date: 2024-05-05
  • Version: 1.1.3

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rickled-1.1.3.tar.gz (33.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page