Skip to content

backend for Product to Politics, provides political activity for some parent companies and their subsidiaries

Notifications You must be signed in to change notification settings

Abiaina/CompanyPoliticsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

See https://github.com/Abiaina/PeoplePowerProductToPolitics/tree/master/ProductToPolitics

Last reconfigured API to use Python3 and containerized it using Docker on 4/5/2020.

API that takes barcode numbers and returns the company that owns this product.

Implemented with Python 3.7.4, Flask, and [external database][data-sources) .

Example Usage - Product To Politics App

Scan any product's barcode to learn about the political implications of your purchases. Product To Politics App

Run Locally

  1. pip install -r requirements.txt
  2. python src/api.py
  3. Visit API's Homepage on http://127.0.0.1:5000/ .
  4. Post to API for political data, run curl -X POST "http://127.0.0.1:5000/api/v2/get_politics"

Run in Docker Locally

  1. docker build .
  2. docker run -p 5000:5000 -i
  3. Visit API's Homepage on http://0.0.0.0:5000/ .
  4. Post to API for political data, run curl -X POST "http://0.0.0.0:5000/api/v2/get_politics"

Configurations, Keys and Environment

Get API keys and store them as environment variables. The config file expects OSKEY for Open Secrets API Key.

Data Sources

Company Financial Political Data Source

Open Secrets Api

Open Secrets API provided the financial-political actions of any large corporations. Reach out to [email protected] directly or ask questions in the group: [email protected]. Learn more here: https://www.opensecrets.org/resources/datadictionary/UserGuide.pdf .

Company Barcode Data Source

EANdata API

UPC Lookup Database API

About

backend for Product to Politics, provides political activity for some parent companies and their subsidiaries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published