Skip to content

Instantly share code, notes, and snippets.

@leogregianin
Created December 3, 2018 13:25
Show Gist options
  • Save leogregianin/9700dd0eda2d5a3f0e9670bf89b91dd8 to your computer and use it in GitHub Desktop.
Save leogregianin/9700dd0eda2d5a3f0e9670bf89b91dd8 to your computer and use it in GitHub Desktop.
JSON export Nubank and NuConta transactions
from pynubank import Nubank
import json
# Login
nu = Nubank('number_id', 'password')
# Credit card
card_statements = nu.get_card_statements()
with open(f'nubank.json', 'w+', encoding='UTF-8') as f:
json.dump(card_statements, f, sort_keys=True, indent=2, ensure_ascii=False)
# NuConta
account_statements = nu.get_account_statements()
with open(f'nuconta.json', 'w+', encoding='UTF-8') as f:
json.dump(account_statements, f, sort_keys=True, indent=2, ensure_ascii=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment