npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bank-transaction-extractor

v1.0.0

Published

Extract bank transactions and convert amounts between currencies

Downloads

81

Readme

npm version License: MIT

Bank Transaction Extractor

A Node.js library for automated transaction extraction from online banking portals with currency conversion support. Designed for financial institutions that use web-based interfaces with CAPTCHA verification.

⚠️ Important Legal Disclaimer

This library is not affiliated, associated, authorized, endorsed by, or in any way officially connected with any financial institution. It is provided "as-is" without any warranties or guarantees. Users are responsible for:

  • Ensuring compliance with all applicable data protection laws and regulations
  • Obtaining necessary permissions for data access and processing
  • Securely handling and storing any extracted financial data
  • Verifying the accuracy of extracted data
  • Using the library in accordance with their banking institution's terms of service

This library is intended for personal finance management only and should not be used to alter, falsify, or misrepresent financial data.

Data Protection & Security Guidelines

  1. Data Privacy:

    • All processing occurs locally on your machine
    • No data is transmitted to external servers
    • Temporary files are automatically cleared
    • Implements secure data handling practices
  2. Security Best Practices:

    • Uses secure HTTPS connections
    • Implements robust authentication
    • Regular security updates
    • Follows standard financial security protocols

Compatibility

This library is compatible with online banking portals that:

  • Implement CAPTCHA verification
  • Provide CSV/Excel export functionality
  • Display transaction history in tabular format
  • Support standard date formats (DD/MM/YYYY)

Features

  • Automated login with CAPTCHA solving
  • Transaction extraction for specified accounts
  • Multi-currency support with conversion
  • TypeScript support
  • Automated cleanup of temporary files

Installation

npm install bank-transaction-extractor

Environment Variables

Create a .env file in your project root with the required variables. You can find a template with all required variables in the .env.example file.

Usage

Basic Usage - Get Transactions

import { getTransactions, Currency } from 'bank-transaction-extractor';

async function main() {
  try {
    const transactions = await getTransactions({
      username: 'your-username',
      password: 'your-password',
      accountNumber: 'your-account-number'
    });
    
    console.log('Transactions:', transactions);
  } catch (error) {
    console.error('Error:', error);
  }
}

Get Transactions with Currency Conversion

import { getTransactions, Currency } from 'bank-transaction-extractor';

async function main() {
  try {
    const transactions = await getTransactions({
      username: 'your-username',
      password: 'your-password',
      accountNumber: 'your-account-number',
      targetCurrency: Currency.USD, // Optional: Target currency
      exchangeRate: 0.032 // Optional: Exchange rate (EGP to USD in this example)
    });
    
    console.log('Converted Transactions:', transactions);
  } catch (error) {
    console.error('Error:', error);
  }
}

Transaction Object Structure

Each transaction object contains:

interface BankTransaction {
  transactionDate: string;
  valueDate: string;
  description: string;
  debitAmount: number;
  creditAmount: number;
  balance: number;
  reference: string;
  currency: string;
}

Error Handling

The library throws errors for various scenarios:

  • Invalid credentials
  • CAPTCHA solving failures
  • Network issues
  • Missing configuration

Always wrap your calls in try-catch blocks for proper error handling.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see the LICENSE file for details