Giter VIP home page Giter VIP logo

fints-institute-db's Introduction

fints-institute-db

CI Crates.io docs license Lines of Code

This is a simple crate providing a convenient and safe interface to FinTS information of German banks. During the build it will download a CSV file with all the banks which it will then put into the library itself so that no extra files have to be taken care of.

Usage

Put this into your Cargo.toml:

[dependencies]
fints-institute-db = "1.0"

Then to use it:

use fints_institute_db::get_bank_by_bank_code;

if let Some(bank) = get_bank_by_bank_code("12070000") {
    println!("{:?}", bank.pin_tan_address);
}

Other use case, find bank by BIC:

use fints_institute_db::get_bank_by_bic;

if let Some(bank) = get_bank_by_bic("GENODEM1MEN") {
    println!("{:?}", bank.pin_tan_address);
}

Command line utility

Additionally this crate includes a CLI tool for your convenience. Use it with

cd fints-institute-db-cli
cargo run
A library and CLI tool to access FinTS access information for many German banks

Usage: fints-institute-db-cli [OPTIONS]

Options:
      --iban <IBAN>                Look up bank by IBAN (format: DE02120300000000202051)
      --bankcode <BANK_CODE>       Look up bank by German bank code (format: 12030000)
      --bic <BIC>                  Look up bank by Bank Identifier Code (BIC) (format: GENODEM1MEN)
  -j, --json                       Change tool behavior to output all data for the record as JSON
      --print-completions <shell>  Generate completion file for a shell [possible values: bash, elvish, fish, powershell,
                                   zsh]
      --print-manpage              Generate man page
  -h, --help                       Print help information
  -V, --version                    Print version information

Example usages:

cargo run -- -b 12030000

cargo run -- -i DE02120300000000202051

This crate is inspired by https://github.com/jhermsmeier/fints-institute-db and https://github.com/dr-duplo/python-fints-url

Releasing

This is mostly a note for me on how to release this thing:

  • cargo release
  • cargo release --execute
  • Releases will automatically be deployed by GitHub Actions.

fints-institute-db's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar sassman avatar svenstaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fints-institute-db's Issues

provide feature to disable cli(clap) for libs

Hello,

can you please provide a feature to disable the cli dependencies for using your lib without pulling in the clap dependency!

serde has a derive feature (no need for serde_derive crate) and serde_json is also cli.

More or less this should be all to do...

# Cargo.toml
[dependencies]
clap = { version = "4", features = ["derive", "cargo", "wrap_help", "deprecated"], optional = true }
clap_complete = { version = "4", optional = true }
clap_mangen = { version = "0.2", optional = true }
iban_validate = "4"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", optional = true }

[features]
default = ["cli"]
cli = ["clap", "clap_complete", "clap_mangen", "serde_json"]
// src/bin/cli.rs
#![cfg(feature = "cli")]

use std::{error::Error, io};

[...]
// tests/cli.rs
#![cfg(feature = "cli")]

use std::process::Command;

[...]

Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.