Skip to main content
https://travis-ci.org/sirex/exportrecipe.svg https://coveralls.io/repos/sirex/exportrecipe/badge.svg https://pypip.in/d/exportrecipe/badge.svg https://pypip.in/v/exportrecipe/badge.svg https://pypip.in/license/exportrecipe/badge.svg

This is a Buildout recipe, that can export buildout configuration to JSON file. Later this exported file can be used to get exported settings and use them in your project.

Buildout provides extensive functionality for managing configuration, but does not have tools to use this configuration anywhere else outside Buildout itself. This recipe exports all settings to JSON file, allowing to use configuration parameters outside Buildout.

Usage

[buildout]
parts = settings

[settings]
recipe = exportrecipe
website-url = http://example.com/

This will generate settings.json file in your buildout directory with following content:

{
  "website-url": "http://localhost:8000/"
}

exportrecipe will export all parameters from recipe’s section, except recipe parameter.

Now you can use this file for example in your settings.py:

import json

with open('settings.json') as f:
    settings = json.load(f)

WEBSITE_URL = settings['website-url']

Also you can use a helper:

import exportrecipe

config = exportrecipe.load('settings.json')

WEBSITE_URL = config.website_url

It is possible to change destination of exported file using destination option:

[buildout]
parts = settings

[settings]
recipe = exportrecipe
destination = somewhereelse.json
website-url = http://example.com/

This will generate somewhereelse.json file with following content:

{
  "destination": "somewhereelse.json",
  "website-url": "http://localhost:8000/"
}

Change History

0.2 (2015-05-17)

  • Initial public release.

Release files for exportrecipe 0.2

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

Source distribution (sdist)

Source distribution for exportrecipe 0.2
File Size Uploaded
exportrecipe-0.2.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for exportrecipe 0.2
File Interpreter ABI Platform
exportrecipe-0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 7.3 kB

Release files / exportrecipe-0.2.tar.gz

Download URL exportrecipe-0.2.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
02662a08c91e079425255e34a402e64126c1743a06582253f9989cec3fd5dc33
BLAKE2b-256 checksum
How to use checksums
41d1536c74151bbc25eebb4e11c1521ed33c7f8e81c7e9c9ac8239d751442bb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / exportrecipe-0.2-py2.py3-none-any.whl

Download URL exportrecipe-0.2-py2.py3-none-any.whl
Size 4.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d8fc39ea010328a86bebf0c5587c0c757e4e0412dec6d673c97a916948b1888c
BLAKE2b-256 checksum
How to use checksums
ad7943a168f8c25af9592b4da4d48481901d4537c3d8c4a032e7ae061a2c6f72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

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