Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
+-------------------------------+---------------------+------------+-----------+
| name | date | type | downloads |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171221 | 2017-12-21T21:33:09 | prerelease | 2 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171215 | 2017-12-15T19:51:45 | prerelease | 13 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171202 | 2017-12-02T22:07:59 | prerelease | 7 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171103 | 2017-11-03T16:16:23 | prerelease | 15 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171026 | 2017-10-26T21:56:57 | prerelease | 4 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171005 | 2017-10-06T09:14:33 | prerelease | 13 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20170929- | 2017-09-29T18:55:50 | prerelease | 7 |
| 2 | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20170921 | 2017-09-21T20:47:27 | prerelease | 7 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20170720 | 2017-07-20T19:25:45 | prerelease | 18 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3 | 2017-07-13T13:15:12 | normal | 286 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170707 | 2017-07-08T07:27:52 | prerelease | 5 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170622 | 2017-06-22T21:12:30 | prerelease | 22 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170608 | 2017-06-08T21:21:46 | prerelease | 13 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170601 | 2017-06-01T19:12:59 | prerelease | 6 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170518 | 2017-05-18T20:23:40 | prerelease | 7 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170511 | 2017-05-11T20:57:45 | prerelease | 3 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170505 | 2017-05-05T21:53:43 | prerelease | 12 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170501 | 2017-05-01T16:27:42 | prerelease | 32 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170427 | 2017-04-27T21:28:07 | prerelease | 9 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170420 | 2017-04-20T22:18:35 | prerelease | 0 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170413 | 2017-04-13T23:04:45 | prerelease | 26 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170331 | 2017-03-31T03:06:19 | prerelease | 36 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc+snapshot-20170323 | 2017-03-23T21:26:51 | prerelease | 17 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.2 | 2016-09-23T20:33:05 | normal | 616 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.1 | 2016-05-31T00:19:42 | normal | 167 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9 | 2016-05-03T10:19:46 | normal | 52 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
Total downloads: 1395
Type prerelease
+-------------------------------+---------------------+------------+-----------+
| name | date | type | downloads |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171221 | 2017-12-21T21:33:09 | prerelease | 2 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171215 | 2017-12-15T19:51:45 | prerelease | 13 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171202 | 2017-12-02T22:07:59 | prerelease | 7 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171103 | 2017-11-03T16:16:23 | prerelease | 15 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171026 | 2017-10-26T21:56:57 | prerelease | 4 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20171005 | 2017-10-06T09:14:33 | prerelease | 13 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20170929- | 2017-09-29T18:55:50 | prerelease | 7 |
| 2 | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20170921 | 2017-09-21T20:47:27 | prerelease | 7 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.4-dev.snapshot-20170720 | 2017-07-20T19:25:45 | prerelease | 18 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170707 | 2017-07-08T07:27:52 | prerelease | 5 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170622 | 2017-06-22T21:12:30 | prerelease | 22 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170608 | 2017-06-08T21:21:46 | prerelease | 13 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170601 | 2017-06-01T19:12:59 | prerelease | 6 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170518 | 2017-05-18T20:23:40 | prerelease | 7 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170511 | 2017-05-11T20:57:45 | prerelease | 3 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170505 | 2017-05-05T21:53:43 | prerelease | 12 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170501 | 2017-05-01T16:27:42 | prerelease | 32 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170427 | 2017-04-27T21:28:07 | prerelease | 9 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170420 | 2017-04-20T22:18:35 | prerelease | 0 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170413 | 2017-04-13T23:04:45 | prerelease | 26 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc.snapshot-20170331 | 2017-03-31T03:06:19 | prerelease | 36 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
| v0.9.3-rc+snapshot-20170323 | 2017-03-23T21:26:51 | prerelease | 17 |
| | Z | | |
+-------------------------------+---------------------+------------+-----------+
Total downloads: 274
Type normal
+--------+------------------------------------------------+--------+-----------+
| name | date | type | downloads |
+--------+------------------------------------------------+--------+-----------+
| v0.9.3 | 2017-07-13T13:15:12Z | normal | 286 |
+--------+------------------------------------------------+--------+-----------+
| v0.9.2 | 2016-09-23T20:33:05Z | normal | 616 |
+--------+------------------------------------------------+--------+-----------+
| v0.9.1 | 2016-05-31T00:19:42Z | normal | 167 |
+--------+------------------------------------------------+--------+-----------+
| v0.9 | 2016-05-03T10:19:46Z | normal | 52 |
+--------+------------------------------------------------+--------+-----------+
Total downloads: 1121
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
import json, requests
from beautifultable import BeautifulTable
url = 'https://api.github.com/repos/ftCommunity/ftcommunity-TXT/releases'
data = json.loads(requests.get(url).text)
releases = []
for release in data:
if release['prerelease']:
type = 'prerelease'
else:
type = 'normal'
name = release['tag_name']
date = release['published_at']
downloads = -1
for asset in release['assets']:
if asset['content_type'] == 'application/zip':
downloads = asset['download_count']
releases.append((name, date, type, downloads))
types = ['prerelease', 'normal']
totalDL = 0
table = BeautifulTable()
table.column_headers = ['name', 'date', 'type', 'downloads']
for name, date, type, downloads in releases:
totalDL += downloads
table.append_row([name, date, type, downloads])
print(table)
print('Total downloads:', totalDL)
print()
for type in types:
print()
print('Type', type)
table = BeautifulTable()
totalDL = 0
table.column_headers = ['name', 'date', 'type', 'downloads']
for name, date, typeR, downloads in releases:
if typeR != type:
continue
totalDL += downloads
table.append_row([name, date, typeR, downloads])
print(table)
print('Total downloads:', totalDL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment