mozilla / active-data-recipes

A repository of various activedata queries and recipes
Mozilla Public License 2.0
8 stars 24 forks source link

Create a configuration object #30

Closed ahal closed 5 years ago

ahal commented 6 years ago

There are certain pieces of data (e.g ActiveData endpoint, log, verbose, etc) that need to be passed around from module to module. Currently they are handled sort of ad-hoc (often by manipulating globals). It would be cleaner to have a configuration object we could store information on. We could ultimately pass this into the recipes (and therefore we could also store arbitrary metadata they might need).

We might eventually also want a configuration file, but I don't think this is worth implementing just yet.

TrangNguyenBC commented 5 years ago

Hi @ahal I want to try this one. Follow your suggestion, I intend to do like this:

  1. Make a configuration class that read from config file
  2. User can overwrite any parameter using command line arguments (i.e --url)
  3. Other modules can get data of this class.
ahal commented 5 years ago

Thanks, sounds like a good plan!

I don't have a super clear idea how this should be implemented, but I think you're on the right track. So Iet's see how the PR looks and we can iterate on it if necessary.

ahal commented 5 years ago

Thanks for your contribution!