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

Goal

The goal of this package is to offer an easy, generic and extendable way of configuring a package.

Installation

$ pip install pkgsettings

Usage

from pkgsettings import Settings

# Create the settings object for your package to use
settings = Settings()

# Now lets defined the default settings
settings.configure(hello='World', debug=False)

By calling the configure you actually inject a layer of settings. When requesting a setting it will go through all layers until it finds the requested key.

Now if someone starts using your package it can easily modify the active settings of your package by calling the configure again.

from my_awesome_package.conf import settings

# Lets change the configuration here
settings.configure(debug=True)

Now from within your package you can work with the settings like so:

from conf import settings

print(settings.debug) # This will print: True
print(settings.hello) # This will print: World

It is also possible to pass an object instead of kwargs. The settings object will call getattr(ur_object, key) An example below:

class MySettings(object):
    def __init__(self):
        self.debug = True

settings = Settings()
settings.configure(MySettings())
print(settings.debug) # This will print: True

More advanced usage

The settings object can also be used as context manager:

with settings(debug=True):
    print(settings.debug) # This will print: True

print(settings.debug) # This will print: False

Additionally you can also use this as a decorator:

@settings(debug=True)
def go()
    print(settings.debug) # This will print: True

go()

print(settings.debug) # This will print: False
Release History

Release History

0.10.0

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.9.3

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.9.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

0.9.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.9.0

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
pkgsettings-0.10.0.tar.gz (12.7 kB) Copy SHA256 Checksum SHA256 Source Jul 15, 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