Skip to main content

Damn Simple Config File Parser.

Project description

About

Just parses ini-style file and return dict with values. Really simple.

Features

  • Knows str, int, list, boolean and None types

  • Supports sections and subsections

  • Supports custom converters

  • Easy to use – one function!

API

parse function takes any iterable (fileobj, for example), which produces strings and returns filled dict or raises ParseError.

parse_file helper function takes path to file, opens it and passes fileobj to parse functino.

FAQ

Q1: Does ‘dosca’ have validation capabilities?

A1: No, it’s not. If you want validate your config, use library designed for this task. Contract, Procrustes or, perhaps, Damn Simple Validation Library?

Q2: Does it support interpolation or some complex types?

A2: No, it’s not. When I say ‘simple’, I mean really simple. Dosca only support basic things, essential for parsing config files. If you want advanced features, use ConfigObj or ConfigParser. Or xml and dtd?

Q3: How to use this library? A3: Just pass fileobj to dosca.parse or see test_dosca.py for details.

Install

~/yourvirtualenv/python setup.py install

pip install dosca

License

The MIT License, in LICENSE file.

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

dosca-2.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dosca-2.0.0.macosx-10.12-x86_64.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file dosca-2.0.0.tar.gz.

File metadata

  • Download URL: dosca-2.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dosca-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c56fcd44445b939ac3751134997e741cb3917db2759c33925d2188114a55b7f2
MD5 f3002d8ecfe7d6f28e64b3ec014c8c77
BLAKE2b-256 52e277211bfd50856f1888912547c350ddcf9c6cc1b4a8c7e42acf8aea1e02bf

See more details on using hashes here.

File details

Details for the file dosca-2.0.0.macosx-10.12-x86_64.tar.gz.

File metadata

File hashes

Hashes for dosca-2.0.0.macosx-10.12-x86_64.tar.gz
Algorithm Hash digest
SHA256 6c396eb2b17a21a63d586ec7627dff42d7e82df10db08e1a8e5d96cf9ff0746f
MD5 84d4566055fa52986a638ff8b8c2ca6f
BLAKE2b-256 6b2d3050dd472799f107cb9bec92383ba66951c516c5f440d4b739ac46ce960e

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