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");
}

§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();
}

Structs§

BitpandaTradeParser
Trade
Defines a single Trade made on Bitpanda exchange

Enums§

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