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

Create a relatedBills.json for same_titles #6

Closed
aih opened this issue Aug 26, 2020 · 2 comments
Closed

Create a relatedBills.json for same_titles #6

aih opened this issue Aug 26, 2020 · 2 comments
Assignees

Comments

@aih
Copy link
Collaborator

aih commented Aug 26, 2020

This is the topic of PR #5

Create an output relatedBills.json that collects bills that have the same title.

The first version of this will be of the form:

{
116s130: {

  same_titles: ['115hr123', '116hr201', ...]
 
},

...

Where the array in same_titles shares any of the titles of the other documents: it is symmetrical, in that if 115hr123 is in the array of same_titles for 116s130, then 116s130 should be in the array corresponding to 115hr123.

I will open another issue for a 'next' step to provide a richer JSON of related bills.

@adamwjo
Copy link
Contributor

adamwjo commented Aug 26, 2020

I believe I have this ready to go. Thanks for the help! There are a few things you have going on in your main() function I dont know about yet, will be looking into those today.

def main(args, loglevel):
  logging.basicConfig(format="%(levelname)s: %(message)s", level=loglevel)
  
  logging.info("You passed an argument.")
  logging.debug("Your Argument: %s" % args.argument)
  
  # TODO consider loading billsMeta before updating
  # TODO consider updating only current congress
  updateBillsMeta()
 
if __name__ == '__main__':
  parser = argparse.ArgumentParser( 
                                    description = "Generates billdata.json metadata file",
                                    epilog = "As an alternative to the commandline, params can be placed in a file, one per line, and specified on the commandline like '%(prog)s @params.conf'.",
                                    fromfile_prefix_chars = '@' )
  parser.add_argument(
                      "-a",
                      "--argument",
                      action='store',
                      dest='argument',
                      help="sample argument")
  parser.add_argument(
                      "-v",
                      "--verbose",
                      dest='verbose',
                      help="increase output verbosity",
                      action="store_true")
  args = parser.parse_args()
  
  # Setup logging
  if args.verbose:
    loglevel = logging.DEBUG
  else:
    loglevel = logging.INFO

@aih
Copy link
Collaborator Author

aih commented Aug 26, 2020

This is now working with PR #5 merged. Closing.

@aih aih closed this as completed Aug 26, 2020
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

No branches or pull requests

2 participants