Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Excel input enabled with --xlsx and Required values made configurable… #30

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

somanath304
Copy link

… in example_config.py file

@kerchner
Copy link
Member

@somanath304 Thanks for this Pull Request. Now that the code requires the xlsx library, you'll need to create a requirements.txt file. Setting the code up will require creating a python virtual environment (such as with virtualenv or venv) and then pip install -r requirements.txt. I'm still going through the code but you can commit that change to this branch, and it will become part of the pull request.

@kerchner
Copy link
Member

@somanath304 Regarding example_config.py - It looks like the example fields ingest_path, ingest_command and debug_mode dropped out. I think we need both the example fields that were there, plus the new ones you added. The user should be able to copy example_config.py to config.py and then run the example with no changes necessary.

Adding the config.py file which contains the ingest_path, ingest_command and debug mode.
This file contains the required values , to add new values append the field name at the end of the list
@somanath304
Copy link
Author

@somanath304 Regarding example_config.py - It looks like the example fields ingest_path, ingest_command and debug_mode dropped out. I think we need both the example fields that were there, plus the new ones you added. The user should be able to copy example_config.py to config.py and then run the example with no changes necessary.

@kerchner - I have deleted the example_config.py file and added the configurable "required values" into config.py file . Now there need not be two config files but just the one which contains all the old data(i.e.ingest_path,ingest_command and debug mode) plus the new data which was added(i.e.required values)

Added requirements.txt file
@somanath304
Copy link
Author

@somanath304 Thanks for this Pull Request. Now that the code requires the xlsx library, you'll need to create a requirements.txt file. Setting the code up will require creating a python virtual environment (such as with virtualenv or venv) and then pip install -r requirements.txt. I'm still going through the code but you can commit that change to this branch, and it will become part of the pull request.

@kerchner Added the requirements.txt file to this branch

@kerchner
Copy link
Member

@somanath304 thanks. A few things:

  • Please move config.py back to example.config.py as it is intended as an example.
  • Update README.md documentation to specify how to use the new --xlsx option
  • Update README.md documentation to specify how to list the required fields, now that this is configurable
  • In the config file, is there a reason that the list of fields is a set, inside {} rather than a tuple, inside () ?
  • In batch_loader.py near the top, where you set required_field_names to cfg1.required, is there a reason that the latter is inside parentheses?
  • What is accomplished by giving a nickname cfg1 for config? (import config as cfg1) . It looks like you only need to reference it once -- but "config" is used several times later.

@somanath304
Copy link
Author

@somanath304 thanks. A few things:

  • Please move config.py back to example.config.py as it is intended as an example.
  • Update README.md documentation to specify how to use the new --xlsx option
  • Update README.md documentation to specify how to list the required fields, now that this is configurable
  • In the config file, is there a reason that the list of fields is a set, inside {} rather than a tuple, inside () ?
  • In batch_loader.py near the top, where you set required_field_names to cfg1.required, is there a reason that the latter is inside parentheses?
  • What is accomplished by giving a nickname cfg1 for config? (import config as cfg1) . It looks like you only need to reference it once -- but "config" is used several times later.

@kerchner Please find the comments inline

  • Please move config.py back to example.config.py as it is intended as an example.- Moved config to example.config
  • Update README.md documentation to specify how to use the new --xlsx option- Instructions on how to run with excel input added
  • Update README.md documentation to specify how to list the required fields, now that this is configurable- Added a section with instructions
  • In the config file, is there a reason that the list of fields is a set, inside {} rather than a tuple, inside () ? Fixed
  • In batch_loader.py near the top, where you set required_field_names to cfg1.required, is there a reason that the latter is inside parentheses? Removed cgf1 ,Fixed
  • What is accomplished by giving a nickname cfg1 for config? (import config as cfg1) . It looks like you only need to reference it once -- but "config" is used several times later Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants