Crate bitpanda_csv

source ·
Expand description

bitpanda-csv

bitpanda-csv is a Rust library to parse the Bitpanda trades exported as CSV from your trades history.

Get started

Add bitpanda-csv to your Cargo.toml 🦀

bitpanda-csv = "^0.2"

Supported features are:

  • no-log: disable logging
  • moveable-feasts (default): enable getters for moveable feasts

Parse CSV

use bitpanda_csv::{BitpandaTradeParser, Trade};
use std::fs::File;

fn main() {
    let reader = File::open("./test/bitpanda.csv").expect("could not open CSV file");
    let trades: Vec<Trade> = BitpandaTradeParser::parse(reader).expect("failed to parse CSV");
}
Run

Parse CSV (async)

Add to your Cargo.toml the async feature. If you don’t need the sync stuff, you can disable the default features then.

use bitpanda_csv::{AsyncBitpandaTradeParser, Trade};
use tokio::fs::File;
use tokio::io::BufReader;

#[tokio::main]
async fn main() {
    let file = File::open("./test/bitpanda.csv").await.expect("could not open CSV file");
    let trades = AsyncBitpandaTradeParser::parse(BufReader::new(file))
        .await
        .unwrap();
}
Run

Structs

Enums

  • Defines the asset name. The asset can be a currency or an asset name (stock code)
  • Defines the asset class type, which is the asset group on Bitanda
  • Defines the list of crypto currencies accepted for deposit/withdrawal on bitpanda
  • A CSV option
  • Defines the currency on Bitanda
  • Defines the FIAT currency on Bitanda
  • Defines the direction of a trade on bitpanda
  • Defines the metal asset.
  • Defines the TransactionType in the bitpanda trade