Example #1
0
def do_stmt(args, config):
    args = merge_config(args, config, stmt=True)

    # Datetime validation/conversion
    for dt in ('dtstart', 'dtend', 'dtasof'):
        setattr(args, dt, converters.DateTime.convert(getattr(args, dt)))

    client = OFXClient.from_args(args)

    ### CONSTRUCT STATEMENT REQUESTS
    accts = {k: getattr(args, k) for k in ('checking', 'savings',
                'moneymrkt', 'creditline', 'creditcard', 'investment')}
    acct_tuple = client.parse_account_strings(**accts)
    stmt_options = {k: getattr(args, k) for k in client.stmt_defaults.iterkeys()}
    client.request_all(*acct_tuple, **stmt_options)

    ### HANDLE REQUEST
    if args.dry_run:
        client.write_request(user=args.user, password='******')
        print client.header + prettify(tostring(client.ofx))
        return

    args.password = getpass()
    client.write_request(user=args.user, password=args.password)

    response = client.download()
    print response.read()
Example #2
0
 def __init__(self, word):
     self.word = word
     self.address = globals.VC % self.word
     super().__init__(self.word, self.address)
     self.all_definitions_raw = self.soup.select(
         'div.sense > h3.definition')
     self.all_definitions = [
         definition.text for definition in self.all_definitions_raw
     ]
     self.all_definitions = [
         utilities.prettify(definition)
         for definition in self.all_definitions
     ]
Example #3
0
def do_profile(args, config):
    # FIXME
    args = merge_config(args, config)
    client = OFXClient.from_args(args)

    if args.dry_run:
        client.write_request(user, 'TOPSECRET')
        print client.header + prettify(tostring(client.ofx))
        return

    args.password = getpass()
    client.request_profile(user=args.user, password=args.password)
    response = client.download()
    print response.read()