Exemplo n.º 1
0
def main():
    args = parser.parse_args()
    conn = establish_connection(args.database)

    s = Scraper(conn, args.root_dir)
    if args.orgs_only:
        s.scrape_organisations()
    elif args.depts_only:
        s.scrape_departments()
    elif args.grants_only:
        s.scrape_grants()
    else:
        s.scrape()
Exemplo n.º 2
0
def main():
    args = parser.parse_args()
    conn = establish_connection(args.database)

    s = Scraper(conn)

    if args.basic:
        if args.year:
            s.scrape_basic(range(args.year, args.year + 1))
        else:
            s.scrape_basic()
    elif args.detailed:
        if args.stdin:
            refs = [x.strip() for x in sys.stdin.readlines()]
            s.scrape_detailed(refs)
        else:
            s.scrape_detailed()
    else:
        s.scrape_all()