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
- Fork it
- Create your feature branch
- Commit your changes
- Push your branch
- 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
Built Distribution
File details
Details for the file bac_bank_parser_gt-0.1.0.tar.gz
.
File metadata
- Download URL: bac_bank_parser_gt-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c6876ca1a10e07caaa39f179cfa37751251d92d3dc18ad75fcde655d7b7f697 |
|
MD5 | 0fb7ed2737ca922a457310ff422fd50a |
|
BLAKE2b-256 | c4baa08d7d0b89a2fb3a44e2fb2b91fb4b749147d603268b9bd32d93eb29fe2e |
File details
Details for the file bac_bank_parser_gt-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: bac_bank_parser_gt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b249817c357d3d04391d4551d25f7107f3cb2bbd0799bc5e17dfec085e0211 |
|
MD5 | b38ddde1987e38b8df5a004e3ba8a75d |
|
BLAKE2b-256 | 115361b87d47ef686003aedd5de5cbaa33b5f13ea175fdd293b01ede60f833c1 |