load_index.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:irs990 作者: CharityNavigator 项目源码 文件源码
def retrieveForYear(year):
    r = boto.connect_s3(host="s3.amazonaws.com") \
            .get_bucket("irs-form-990") \
            .get_key("index_%i.json" % year) \
            .get_contents_as_string() \
            .replace("\r", "")
    j = json.loads(r)

    # The index comes back as a single JSON key-value pair whose value is
    # a JSON array of length one. Inside _that_ is an array of filings.

    filings = j.values()[0]

    if cred.prod:
        return filings
    else:
        sample = filings[0:1000]
        return sample
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号