diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-19 14:21:30 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-19 14:21:30 -0600 |
| commit | d91a146198ea2f5e2ca0cfa45948913e878ff315 (patch) | |
| tree | 0a33ecb1ca4ad9697c8e34673e73b4a076f39979 | |
| parent | Fix example heading that is too large (diff) | |
| download | config-file-d91a146198ea2f5e2ca0cfa45948913e878ff315.zip | |
Add section on using your own parser
Also, a sentence is added on what is exposed to the public API.
| -rw-r--r-- | README.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -20,6 +20,8 @@ $ pip install config_file ## Example +The `config_file` package exposes `ConfigFile`, `ParsingError`, and `BaseParser` to the public API. + ### Sample Configuration File `config.ini` @@ -120,3 +122,9 @@ config.reset() config.reset(original_file_path="~/some_other_directory/this_is_actually_the_original.ini") >>> True ``` + +## Using your own parser + +> This feature is a work in-progress and has not been tested yet. + +You can still use config file, even if you don't use one of our supported configuration formats. The `ConfigFile` object swaps in the parser it needs based on the file format. However, the constructor takes in an optional `parser` argument that you can use to supply your own custom parser. The only requirement is that the parser must be a concrete implementation of `BaseParser`. |