Skip to main content

Banrural Parser

Project description

Banrural Scrapper

Python library to scrap Banrural Website

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

How to use it

Installation

pip install banrural-scrapper-gt

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

Usage

Precautions

  • Don't access to Banrural 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 banrural_bank_gt import BanruralBank, UserPasswordBankLogin

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

# We are logout now

Get accounts

from banrural_bank_gt import BanruralBank, UserPasswordBankLogin

credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")
with BanruralBank(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 BanruralBankAccount

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

with BanruralBank(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 Banrural.

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

    bank = BanruralBank(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 banrural 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

banrural_bank_parser_gt-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

banrural_bank_parser_gt-0.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file banrural_bank_parser_gt-0.1.1.tar.gz.

File metadata

  • Download URL: banrural_bank_parser_gt-0.1.1.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

Hashes for banrural_bank_parser_gt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d490543aab3ee87bc17f8acde8e32f8b749ef713f7708839c7c97589321606c2
MD5 0d6e62879b827d210ed1d9bcb9e25e3f
BLAKE2b-256 1912074faf39a24de392bc4c4e1dcc3ce494b89847fce0ec2e2245c3a0d52868

See more details on using hashes here.

File details

Details for the file banrural_bank_parser_gt-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: banrural_bank_parser_gt-0.1.1-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

Hashes for banrural_bank_parser_gt-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 976e9cb12da1548c10e46fe7e37bd3cc6e356d7bed06591b04d14a926525a8c2
MD5 b168c951ff4074e7e5ef5fba7224f076
BLAKE2b-256 b7c19ffbaabf3077a875656ad3a01f4b8b7e3e7e27a70fe7adad3f5410859174

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