Skip to main content

Banco America Central (BAC) Parser

Project description

BAC Scrapper

Python library to scrap BAC Website

The intended use of this library is to make it easy to access BAC bank data to allow the automatisation of processes that currently banks doesn't allow.

How to use it

Installation

pip install bac-scrapper-gt

If you are using requirements.txt just add bac-scrapper-gt into the file

Usage

Precautions

  • Don't access to BAC website or mobile app while executing some script usign this library.
  • Login with the library will fail if you are logged in from the website or mobile app.

Login

The recommended method for login is using with statement of Python. We initialize the class in the with and will make automatically login with the provided credentials and will logout after finishing all the work and if some exception happens we ensure that logout method is called.

from bac_bank_gt import BACBank, UserPasswordBankLogin

credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")
with BACBank(credentials) as connection:
    # Do your work here

# We are logout now

Get accounts

from bac_bank_gt import BACBank, UserPasswordBankLogin

credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")
with BACBank(credentials) as connection:
    accounts = connection.fetch_accounts() # Fetch all accounts
        for a in accounts:
            print(a)

Get movements

We can retrieve the movements of an account using fetch_movements method in BACBankAccount

import datetime
from bac_bank_gt import BACBank, UserPasswordBankLogin
credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")

with BACBank(credentials) as connection:
    accounts = connection.fetch_accounts()
    for a in accounts:
        mov = a.fetch_movements(
            datetime.date.today() - datetime.timedelta(days=60),
            datetime.date.today() + datetime.timedelta(days=1),
        )
        for m in mov:
            print(m)

Logout

It's important to logout after you finish your operations otherwise you can lock yourself and that won't allow you to login from the website, that's due security protections of BAC.

Even though with statement is the recommended way to make sure logout method is called. You can also execute it manually.

    bank = BACBank(credentials)
    try:
        bank.login()
        # Do your work
    except:
        pass
    finally:
        bank.logout()

Contributing

  1. Fork it
  2. Create your feature branch
  3. Commit your changes
  4. Push your branch
  5. Create a pull request

FAQ

  • Why I need to enter my credentials? It is safe?
    • We need your credentials to authenticate in the bank, those credentials are not stored in any place. This is open source library so you can check the code.
  • Can you make some program for me using this library?
    • Of course, this library provides a base for another utilities and potentially any thing that is on the website of BAC is under subject for automatization, if you need some customization or build a program on top of this library please contact me at dev at csimon (dot) dev and I will be happy to help you.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bac_bank_parser_gt-0.2.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

bac_bank_parser_gt-0.2.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file bac_bank_parser_gt-0.2.1.tar.gz.

File metadata

  • Download URL: bac_bank_parser_gt-0.2.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for bac_bank_parser_gt-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f1ee4be10acdaa54839d60ff304c8fa0bf14ed4b86d378a8bda6eeddab1a7647
MD5 bb1407bfbe3f73d4c65b309d6b9f44a7
BLAKE2b-256 c32893fafff310194050a9a902c67b5937c32c7c812d8d0c4dba81549f274668

See more details on using hashes here.

File details

Details for the file bac_bank_parser_gt-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bac_bank_parser_gt-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for bac_bank_parser_gt-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76c6feb3bd0a0c1e3aa42a5b47f2a3c3622517dc8e5aa7728806101242170bdf
MD5 928a0050abb948bf8b864d9df84b84e6
BLAKE2b-256 32929400ee642b9670db67f4e5e4d73b07f0d2c6d4ae34479cc0f54d9503c645

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page