nchah / github-traffic-stats

Get statistics on web traffic to your GitHub repositories.
https://pypi.org/project/github-traffic-stats/
121 stars 31 forks source link

Send data to database #15

Closed oshadmon closed 6 years ago

oshadmon commented 6 years ago

Changes

  1. Added an option instead of sending data to csv, user can send it to PSQL -- requires tables found in create_table.sql -- If data already exists in a table, then it wont be added -- doesn't generate SQL files
  2. The print to screen annoyed me (while testing), thus added an option to disable it (false by default)

Missing

  1. Automated testing

Example (with disabled printing) python3 gts/main.py user@github.com github-traffic-stats set_db -hp 127.0.0.1:5432 -usr root:'' -name test -o user -print False

oshadmon commented 6 years ago

@nchah @thirschbuechler @AnthonyBloomer Is anyone going to review this change?

nchah commented 6 years ago

@oshadmon Thanks for the additional features! I can take a look sometime this week unless anyone else beats me to it.

nchah commented 6 years ago

Thanks @oshadmon ! Merging this in, confirmed to work with postgres on my machine.