U.S. National Debt - Chart Generator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
.gitignore
LICENSE
README.md
requirements.txt
usnationaldebtchartgen.py

README.md

usnationaldebtchartgen

U.S. National Public Debt - Chart Generator

Synopsis

Generate chart image, pdf, or SVG of the U.S. National Public Debt from data scraped from the U.S. Treasury website.

The output for the chart is generated by the open source Highcharts export server.

The chart is best viewed in a browser thanks to another project: pubdata.github.io/usnationaldebtchart

Installation

This is a Flask app (Python3).

$ cd [your workspace]
$ git clone https://github.com/pubdata/usnationaldebtchartgen.git
$ cd usnationaldebtchartgen
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Further deploy instructions will vary based on production system requirements.

For testing, use gunicorn:

$ gunicorn usnationaldebtchartgen:app

From a browser, access the app using: http://localhost:8000/chart

Optionally, you can specify the filename and file extension (.png, .jpg, .pdf, or .svg) to access a specific output format. For images and PDFs, you can also specify the image width (e.g., bob-1200.jpg for a 1200 pixel wide JPEG image with a personalized filename).

Example

License

MIT