This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Figtree is a multi-format configuration file loader that normalizes all values into dictionaries and supports merging multiple configuration files into a single source. The later can be useful if you have multiple configuration sources and either want to load the first found or override default settings (such as having a system wide and per user configuration file).

Figtree supports the following configuration file formats:

  • YAML
  • JSON
  • XML (Currently ignores attributes)
  • INI (Currently does not support dictionaries within lists)

The Figtree API is also easily extensible to support new structured file formats through automatic registration of format handlers.

Simple Example

Configuration source: /etc/myproject/settings.yml

section:
  debug: on
  complex:
    structure:
      value: 100
      multi:
        - 1
        - 2
        - 3
flag: off

Loading and access data.

import figtree

conf = figtree.load_config('@/etc/myproject/settings.yml')

# configuration instances are dictionary like
flag_set = conf['flag']

# nested structures are also dictionary like
is_debugging = conf['section']['debug']

# easier lookups to avoid intermediate key checks
is_debugging = conf['section.debug']
is_debugging = conf.get('section.debug', False)

# sub-dictionaries can be accessed the same way
conf_section = conf['section']
value = conf_section['complex.structure.value']

Loading Options

Configuration files can be loaded from the following sources:

  • Files (Local and HTTP accessible)
  • String Literals
  • Dictionary Objects

Merge Settings

Load in order and merge settings. The last item has overrides others.

import figtree

conf = figtree.load_config(
    (
        {
            'section': {
                'debug': True
            },
            'flag': False
        },
        '/etc/myproject/settings.yml',
        'https://mydomain.test/settings',
        figtree.LiteralConfigSource('flag: off', hint='yaml')
    )
)

First Found

Load the first found source. Mostly useful for file based sources.

import figtree

conf = figtree.load_first_found_config(
    (
        'settings.yml',
        '~/.settings.yml',
        '/etc/myproject/settings.yml'
    )
)
Release History

Release History

0.2.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
figtree-0.2.2.tar.gz (7.7 kB) Copy SHA256 Checksum SHA256 Source Aug 16, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting