Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Python function call 'scrape' #70

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stuchalk
Copy link

@stuchalk stuchalk commented Oct 4, 2022

Addition of Python a bare bones function call 'scrape' (functions.py file) for processing config file from another Python script and returning the JSON output.

…from another Python script and returning the JSON output
Copy link
Member

@IanLee1521 IanLee1521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuchalk - this looks good overall.. Do you think this would be good to adapt the main script to use this method as well? Just for consistency?

Comment on lines +25 to +26
f = open(configfile)
config_json = json.load(f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f = open(configfile)
config_json = json.load(f)
with open(configfile) as fp:
config_json = json.load(fp)

# process
code_json = code_gov.process_config(config_json)
code_gov.force_attributes(code_json, config_json)
logger.info("Number of Projects: %s", len(code_json["releases"]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this logger call should move in to code_gov.process_config(...) so that the message happens at the time the objects are parsed? Thoughts?

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

Successfully merging this pull request may close these issues.

None yet

2 participants