Skip to main content

Parse configuration files written in a Python-like syntax

Project description

Configuration files with a Python-like syntax

Parse a very Python-like mini-language to produce a dictionary. This allows Python programs to be configured using a Python-like language consisting of dictionaries, tuples, and literal values. Plasmic dictionary keys must be literal values. Plasmic dictionary values can be literal values and, possibly nested, tuples and other plasmic dictionaries.

Here is a sample configuration:

{section1:
  {key1: "value1",
   key2: 2},
 section2:
  {key1: "othervalue",
   key3: 3.0
   subsection1:
    {key4: (1, 2, 3)
     key5: {"foo": "meta",
            "bar": "syntactic"}
    }
  }
}

As a convenience all dictionary entries keyed by symbols have their keys converted to the lower case string equivalent.

The plasmic Python-like language contains almost no expression evaluation. The single, optional, expression allowed is a string.Formmatter.format() formatting syntax used for interpolation – the insertion of of data into values by reference to Plasmic dictionary keys.

The recommended suffix for files written in the Plasmic language is: .pcf

Sub-Projects

Plasmic has the following sub-projects to support configuring applications using files written in Plasmic. Most users will not want to use plasmic directly but will import one of these sub-projects.

plasmic.configparser

A configparser-like API for the reading and writing of configuration files in plasmic syntax.

import plasmic.configparser

plasmic.montague

A plugin allowing Plasmic configuration files to drive the Montague WSGI component loader.

Complete Documentation

The complete documentation set can be found on the Plasmic home page at http://plasmic.readthedocs.org/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plasmic-0.2.1.tar.gz (27.5 kB view details)

Uploaded Source

File details

Details for the file plasmic-0.2.1.tar.gz.

File metadata

  • Download URL: plasmic-0.2.1.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for plasmic-0.2.1.tar.gz
Algorithm Hash digest
SHA256 042591425d01028fe491f7e6b0e7ade0059f9f9c4ed20d9d1523d3a3f7a98de0
MD5 9cd34cfcf81eba1f7b52cbb1f96e9728
BLAKE2b-256 1bbb0601dc8bcb4abe1cadb47140fa1e46a2b1de43eb60ca01dff6b7afbd0350

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page