Created
November 6, 2015 03:20
-
-
Save marcoceppi/7eb49caac1ea0b90487e to your computer and use it in GitHub Desktop.
Charm store activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import humanize | |
import requests | |
import datetime | |
import tabulate | |
from dateutil.parser import parse | |
r = requests.get('https://api.jujucharms.com/charmstore/v4/changes/published?start=2015-10-28') | |
results = [] | |
for e in r.json(): | |
dt = parse(e['PublishTime']).replace(tzinfo=None) | |
data = dict() | |
data['charm'], data['version'] = os.path.basename(e['Id']).rsplit('-', 1) | |
data['ago'] = humanize.naturaltime(datetime.datetime.utcnow() - dt) | |
#print('NAME {charm} rev{version} {ago}'.format(**data)) | |
results.append(['NAME', data['charm'], data['version'], data['ago']]) | |
print(tabulate.tabulate(results, tablefmt='simple', headers=['user', 'charm', 'rev', 'updated'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
argparse==1.2.1 | |
humanize==0.5.1 | |
python-dateutil==2.4.2 | |
requests==2.8.1 | |
six==1.10.0 | |
tabulate==0.7.5 | |
wsgiref==0.1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment