예제 #1
0
    def handle(self, *args, **options):

        nu = Nubank()
        uuid, qr_code = nu.get_qr_code()

        qr_code.print_ascii(invert=True)

        nu.authenticate_with_qr_code(NUBANK_CPF, NUBANK_PASSWORD, uuid)
        print(nu.get_account_balance())

        card_statements = nu.get_card_statements()
예제 #2
0
파일: main.py 프로젝트: caarlos0/nuofx
    'BillPaymentEvent',
)

# used to test from a json file with the statements
if test_file == "":
    if cpf == "" or pwd == "":
        print("missing cpf and/or password")
        raise SystemExit()

    uuid, qr_code = nu.get_qr_code()
    qr_code.print_ascii(invert=True)
    input('scan and press enter...')
    nu.authenticate_with_qr_code(os.environ['NU_CPF'], os.environ['NU_PWD'],
                                 uuid)

    balance = nu.get_account_balance()
    statements = list(
        filter(lambda x: x['__typename'] in PAYMENT_EVENT_TYPES,
               nu.get_account_feed()))
else:
    with open(test_file) as json_file:
        statements = json.load(json_file)
        balance = 1233.11

print(
    f'creating 90-day OFX file of account with balance {balance} at {target}...'
)

# here begins the uglyness
# I'm extremely regretful right now
ofx = ET.Element("OFX")