Skip to content
/ turf Public

Configuration and environment inspection library

License

Notifications You must be signed in to change notification settings

lwcolton/turf

Repository files navigation

Full Documentation

turf

https://travis-ci.org/HurricaneLabs/turf.svg?branch=master

Configuration and environment inspection library

Turf makes managing configuration for your Python application easy. It provides a standard file access and naming convention, as well as extensive configuration validation. Turf allows you to specify what your applications configuration should look like, and then worry about your application and not parsing config files.

Get Turf

Run the tests

git clone git@github.com:HurricaneLabs/turf.git
cd turf
tox

Examples

Basic Configuration Manager

$ cat /tmp/turftest/foo.yml
---
blah: bar
from turf.config import BaseConfig

class MyConfig(BaseConfig):
    config_dir = "/tmp/turftest"
    schema = {"foo":{"blah":{"type":"string"}}}

config = MyConfig()
print(config["foo"]["blah"])

Will produce:

bar

S3 Config Example IAM Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:GetObject",
                "s3:ListBucket",
                "s3:PutObject"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::my-app-config",
                "arn:aws:s3:::my-app-config/*"
            ],
            "Principal": {
                "AWS": [
                    "arn:aws:iam:::role/my-app-role"
                ]
            }
        }
    ]
}

About

Configuration and environment inspection library

Resources

License

Stars

Watchers

Forks

Packages

No packages published