GithubHelp home page GithubHelp logo

karlnicholas / congress-legislators Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 150 KB

This program parses the congressional legislators yaml file into java beans.

License: MIT License

Java 100.00%

congress-legislators's Introduction

This program parses the congressional legislators yaml file into java beans. The original files are found at https://github.com/unitedstates/congress-legislators

The java beans can then be easily worked with to extract desired information

This main class, GovTrackRecords, reads the legislators files and then streams them so they can be manipulated using Java-8 lambda expressions.

The program assumes that the congress-legislators files will be in the src/main/resources directory. You will need to get a copy of them from the above link. See getting started below.

I wrote it so as to extract congressional party information between the years 1960 and 2017 and create a CSV file with the number of democrat and republican legislators for each region of the US. It made a nice graph. See reps.txt and reps.xlsx.

		****** Getting Started ********

1: Clone this repository. You can import it into Eclipse, with File->Import->Check out Maven Project from SCM.

3: The project needs at least JDK version 8.

4: You will need to get the legislators-historical.yaml and the legislators-current.yaml files and put them into the src/main/resources directory.

5: Instantiate GovTrackRecords and then call the .stream() method.

6: There are two example program files in the default package, which is in the src/main/java directory.

a. GovTrackFilterExample: This program reads the data
and does an simple filter by lastname and prints out the count. 
It shows a simple and not too complicated example of working with 
the Java Beans. See the comments in the file for more information.

b. ExportPartiesByRegion: This is the program that 
created reps.txt which was used to create the reps.xlsx

7: Packages are: a. model: has the java beans for each of the different GovTrack data nodes.

congress-legislators's People

Contributors

karlnicholas avatar knicholas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.