Esempio n. 1
0
def main():
    with open("info.json", "r") as file:
        settings = json.load(file)
    attendees = he.get_attendee_list(settings["event_id"], settings["token"])
    eighth = he.get_people_answered(attendees, "8th grade", "26350001")
    seventh = he.get_people_answered(attendees, "7th grade", "26350003")
    seventh.extend(he.get_people_answered(attendees, "7th", "26350003"))
    seventh.extend(he.get_people_answered(attendees, "7", "26350003"))
    sixth = he.get_people_answered(attendees, "6", "26350003")
    ms = []
    ms.extend(eighth)
    ms.extend(seventh)
    ms.extend(sixth)
    names = []
    for person in ms:
        name = (person["profile"]["first_name"] + "_" +
                person["profile"]["last_name"]).lower()
        if name not in names:
            names.append(name)
    clone_and_copy(settings["repo_url"], "dest", names)
import json
import hackbi_eventbrite as he

with open("secret.json", "r") as file:
    secrets = json.load(file)
event_id = secrets["event_id"]
token = secrets["token"]

hs = [
    "Freshman / 9th grade", "Sophomore / 10th grade", "Junior / 11th grade",
    "Senior / 12th grade"
]

attendees = he.get_attendee_list(event_id, token)
hs_atts = []
for grade in hs:
    hs_atts.extend(he.get_people_answered(attendees, grade, "26350001"))
ms_atts = [attendee for attendee in attendees if attendee not in hs_atts]


def count_names(atts):
    alph = [
        "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
        "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
    ]
    dist = {}
    for letter in alph:
        dist[letter] = 0
    for att in atts:
        last = att["profile"]["last_name"].lower()
        dist[last[0]] += 1
Esempio n. 3
0
            except KeyError:
                pass
            try:
                api_key = options["api_key"]
            except KeyError:
                pass
            try:
                filename = options["file_name"]
            except KeyError:
                pass

        if args.api_key is not None:
            api_key = args.api_key
        if args.event_id is not None:
            event_id = args.event_id
        if args.file_name is not None:
            filename = args.file_name

        msg = "missing required arguments: "
        if event_id is None:
            msg += "event_id "
        if api_key is None:
            msg += "api_key "
        if filename is None:
            msg += "file_name "
        if None in [event_id, api_key, filename]:
            raise ValueError(msg)

    att_list = get_attendee_list(event_id, api_key)
    save_attendees(att_list, filename)