Skip to main content

Plaster Dynaconf

Introduction

By default, Pyramid use a pasteDeploy ini format file to loads its configuration,

here is a plugin to use Dynaconf instead to configure your pyramid application.

e.g.

pserve dynaconf://settings.yml

Why another Configuration Loader for Pyramid's plaster?

To answer this weustion lets have a look about what is so cool on Dynaconf. With the creation of Dynaconf the autor(s) have created a tool that handles the reading of configuration data very well. This is especially true for applications that are developed to be deployed in different enironments. Most of web applications are that kind of thing. In development of such applications you know how the settings should be for your development environment and everything that is no specific to your env and no secret should be in the source code. But The idea of 12-factor-apps goes even farther everything what one knows about the environment types the application will be deployed should be in the source too and be overridden or extended with secrets in the specific env with environment varibales.

You can do this with pasteDeploy too, but the need of different files for different environments is not as convinient as one default settings file with useful defaults for different environments that can overridden by the environments. And what environemnt is present is set by the environment and not by the file.

On my flask driven apps using dynaconf the start up of the application looks everythere the same flask run. I wanted to have a similar approach for my pyramid apps. pserve dynaconf://settings.yml

Maybe it could even go as far as pserve dynaconf:// but I am not sure if it is worth to do that much implicit especially because since dynaconf3 less things happen implicit than before.

When will this be on version 1.x.y?

If I or someone else had time to write some good tests. Vecause this packages is mainly an integration piece of dynaconf and plaster with the clear destination to be used with pserve for pyramid there are not just unit tests required. For now it "works for me" applies and I do not want to let this kind of measurement be the one for version 1.x.y .

Installation

pip install plaster-yaml

Usage

This package registers itself by default for the entrypoint 'plaster.loader_factory' so that it can be used in the way described above. If you wish to be able to do something like pserve settings.yml you have to add a configuration for the entry point for file+yml to your setup.py or example:

setup(
    ...,
    entry_points={
     'paste.app_factory': ['main = <my_app>:main'],
     'plaster.loader_factory': ['file+yml = plaster_yaml:Loader'],
     ...
    },
)

You must run pip install -e . to finallize the registration.

Troubleshouting

If you get the following exception:

plaster.exceptions.LoaderNotFound: Could not find a matching loader for the scheme "file+yaml", protocol "wsgi".

It meast that you did not register the entry point. Read the usage section for to register it properly.

Release files for plaster-dynaconf 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for plaster-dynaconf 0.1.0
File Interpreter ABI Platform
plaster_dynaconf-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / plaster_dynaconf-0.1.0-py3-none-any.whl

Download URL plaster_dynaconf-0.1.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe737ec91397a11b6f998d7016efa464aca06216e2bc5d0f940de6c0ecd0005e
BLAKE2b-256 checksum
How to use checksums
ea26db9c8fb0da0db45ae5d4138a553532f7194040b15af8fa589f4ad0abc10c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page