def handle(self, *args, **options):
        fec_time = pytz.timezone('US/Eastern')  #fec time is eastern

        if options['repeat-interval']:
            repeat_interval = int(options['repeat-interval'])
        else:
            repeat_interval = None

        if options['filing_dir']:
            filing_dir = options['filing_dir']
        else:
            filing_dir = 'filings/'

        while True:
            print("Pulling filings from RSS feed")
            #keep looping if an interval is provided, this is mostly for testing
            filings = loader.filing_list_from_rss()
            if not filings:
                print("failed to find any new filings in the RSS feed")
            else:
                loader.download_filings(filings, filing_dir)
                loader.load_filings(filing_dir)

            if repeat_interval:
                time.sleep(repeat_interval)
            else:
                break

            if repeat_interval:
                time.sleep(repeat_interval)
            else:
                break
Beispiel #2
0
    def handle(self, *args, **options):
        fec_time = pytz.timezone('US/Eastern')  #fec time is eastern

        if options['filing_id']:
            filing_id = options['filing_id']
        else:
            print("filing_id required")
            return
        if options['filing_dir']:
            filing_dir = options['filing_dir']
        else:
            filing_dir = 'filings/'

        loader.download_filings([filing_id], filing_dir)
        loader.load_filings(filing_dir)
Beispiel #3
0
    def handle(self, *args, **options):
        fec_time = pytz.timezone('US/Eastern')  #fec time is eastern

        unparsed_start = datetime.datetime.now(fec_time) - datetime.timedelta(
            days=2)
        start_date = unparsed_start.strftime('%Y%m%d')
        unparsed_end = datetime.datetime.now(fec_time) + datetime.timedelta(
            days=1)
        end_date = unparsed_end.strftime('%Y%m%d')

        if options['start']:
            start_date = options['start']
        if options['end']:
            end_date = options['end']
        if options['repeat-interval']:
            repeat_interval = int(options['repeat-interval'])
        else:
            repeat_interval = None
        if options['filing_dir']:
            filing_dir = options['filing_dir']
        else:
            filing_dir = 'filings/'

        while True:
            print("looking for filings for period {}-{}".format(
                start_date, end_date))
            #keep looping if an interval is provided, this is mostly for testing
            filings = loader.get_filing_list(start_date, end_date)
            if not filings:
                print("failed to find any filings for period {}-{}".format(
                    start_date, end_date))

            loader.download_filings(filings, filing_dir)
            loader.load_filings(filing_dir)

            if repeat_interval:
                time.sleep(repeat_interval)
            else:
                break

            if repeat_interval:
                time.sleep(repeat_interval)
            else:
                break