Arquitectura de datos del proyecto Fedora
Alberto es tu amigable vecino que colabora en el Proyecto Fedora.
fedmsg (Federated Message Bus) antes Fedora Messaging, es una biblioteca que usa ZeroMQ (PyZMQ) para conectar servicios de publicacion de mensajes
Linea de comandos
sudo dnf install httpie
http get https://apps.fedoraproject.org/datagrepper/raw delta==172800
http get https://apps.fedoraproject.org/datagrepper/raw delta==172800 rows_per_page==1
http get https://apps.fedoraproject.org/datagrepper/raw \
delta==172800 \
rows_per_page==1 \
page==2
http get https://apps.fedoraproject.org/datagrepper/raw \
delta==172800 \
category==bodhi \
category==wiki
http get https://apps.fedoraproject.org/datagrepper/raw \
delta==172800 \
user==bt0dotninja
#!/usr/bin/env python3
# A simple class to get geographical data from fas and FedoraAsk
# Alberto Rodriguez Sanchez bt0dotninja@fedoraproject.org
# Renato Silva resilva87@fedoraproject.org
from fedora.client.fas2 import AccountSystem
from fedora.client import AuthError
from collections import Counter
from datetime import datetime
import sys
import numpy as np
import pandas as pd
import json
import requests
import configparser
class geofp(object):
'''
An object for querying the Fedora Account System and get Geographical data from groups and the whole project
'''
def __init__(self,ConfigFile):
'''A Simple constructor for geofp object'''
Config = configparser.ConfigParser()
Config.read(ConfigFile)
options = Config.options('FAS')
userdata={}
for opt in options:
userdata[opt] = Config.get('FAS', opt)
user=userdata['user']
password=userdata['pass']
self.members=None
self.fas = AccountSystem(username=user, password=password)
def by_group(self, group, active_date=None):
'''get information by group'''
groupMembers=self.fas.group_members(group)
GeoData={}
for member in groupMembers:
gd=self.fas.people_by_key(key=u'username', search=member['username'])
GeoData.update(gd)
#To pandas DataFrame
self.members=pd.DataFrame.from_dict(GeoData, orient='index')
self.members['last_seen']=pd.to_datetime(self.members.last_seen)
#subsetting by date
if active_date!=None:
self.members=self.members[(self.members.last_seen >= active_date) & (self.members.status == 'active')]
return self.members
Reemplaza la antigua plataforma.
RESTless también.