Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/walterbm/govtrack-elixir
Simple Elixir package for the govtrack.us API
https://github.com/walterbm/govtrack-elixir
Last synced: 7 days ago
JSON representation
Simple Elixir package for the govtrack.us API
- Host: GitHub
- URL: https://github.com/walterbm/govtrack-elixir
- Owner: walterbm
- License: mit
- Archived: true
- Created: 2016-07-31T03:41:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-16T07:19:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T12:35:17.625Z (about 1 month ago)
- Language: Elixir
- Homepage:
- Size: 310 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A simple Elixir wrapper for the [govtrack.us](https://www.govtrack.us/developers) API. (Third Party APIs)
- fucking-awesome-elixir - govtrack - A simple Elixir wrapper for the [govtrack.us](https://www.govtrack.us/developers) API. (Third Party APIs)
- awesome-elixir - govtrack - A simple Elixir wrapper for the [govtrack.us](https://www.govtrack.us/developers) API. (Third Party APIs)
README
# Govtrack
[![Build Status](https://travis-ci.org/walterbm/govtrack-elixir.svg?branch=master)](https://travis-ci.org/walterbm/govtrack-elixir) [![Hex.pm](https://img.shields.io/hexpm/v/govtrack.svg?maxAge=2592000?style=flat-square)](https://hex.pm/packages/govtrack)
# ⛔️ DEPRECATED ⛔️
_The GovTrack API was shutdown in December 2016_---
An elixir wrapper for the [govtrack.us](https://www.govtrack.us/developers) API that provides programmatic access to information about the U.S. Congress.
## Installation
[Available through Hex](https://hex.pm/packages/govtrack), and can be installed by:
1. Adding `govtrack` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:govtrack, "~> 0.7.3"}]
end
```2. Ensuring `govtrack` is initialized before your main elixir application:
```elixir
def application do
[applications: [:govtrack]]
end
```## Usage
This `Govtrack` module is meant to be a simple wrapper for the official [govtrack.us](https://www.govtrack.us/developers) API. The module automatically parses the JSON response and provides a few sensible defaults to common queries.
### Supported Endpoints:
- [bill](https://www.govtrack.us/developers/api#endpoint_bill)
- [cosponsorship](https://www.govtrack.us/developers/api#endpoint_cosponsorship)
- [person](https://www.govtrack.us/developers/api#endpoint_person)
- [role](https://www.govtrack.us/developers/api#endpoint_role)
- [vote](https://www.govtrack.us/developers/api#endpoint_vote)
- [vote_voter](https://www.govtrack.us/developers/api#endpoint_vote_voter)
- [committee](https://www.govtrack.us/developers/api#endpoint_committee)
- [committee_member](https://www.govtrack.us/developers/api#endpoint_committee_member)### Basic Usage
```elixir
Govtrack.bills #=> Fetch all bills, ordered by most recently updatedGovtrack.bill(12700) #=> Fetch information about a specific bill
```### Querying
An optional `query` parameter can be passed to all the supported endpoints to narrow the results. The specific query strings are dictated by the [govtrack API](https://www.govtrack.us/developers/api).```elixir
Govtrack.roles([current: true, state: "NY"]) #=> Fetch all representatives for the State of New York.
```