GithubHelp home page GithubHelp logo

jackson15j / python_homework_config_file_parser Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 68 KB

Coding Test for parsing config files from first principles

License: GNU Affero General Public License v3.0

Python 100.00%

python_homework_config_file_parser's People

Contributors

jackson15j avatar

Watchers

 avatar

python_homework_config_file_parser's Issues

Parser module implementation

Rough thoughts around the Parser module to satisfy the requirements of:

  • Parse config files (JSON).
  • Gracefully ignore files that do not parse.
  • Config files read later on MUST override values.
  • Support other content schema`s outside of JSON.

Code wise, my thoughts currently are:

  • parsers module:
    • IParser interface class for base file parsing to a parsed_dict.
    • JsonParser class that implements JSON parsing.
    • ... place for other file parser's. eg. YAML.

Parsing to a dictionary since it is a nested structure, built-in override
updates, and look-ups in a similar form to dotted paths.

Create a Lookup class from existing `parser.py`

I am decoupling the Parsing (#6) and Lookup workflows. Thinking that in the
future it would benefit workflows like:

  • Non-Decoupled: "one-time parse + single lookup".
  • Decoupled: "one-time parse, store/get, multiple lookups".

Code-wise, my current thoughts for a lookup module is:

  • Convert dotted path to dict lookup.
  • lookup value from Parser's parsed_dict.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.