1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
//! # 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 🦀
//!
//! ```toml
//! bitpanda-csv = "^0.1.0"
//! ```
//!
//! Supported features are:
//!
//! - `no-log`: disable logging
//! - `moveable-feasts` (*default*): enable getters for moveable feasts
//!
//! ### Parse CSV
//!
//! ```rust
//! 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");
//! }
//! ```
//!
#![doc(html_playground_url = "https://play.rust-lang.org")]
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde;
#[cfg(feature = "mock")]
pub(crate) mod mock;
mod parser;
mod trade;
#[cfg(feature = "mock")]
pub use mock::TradeGenerator;
pub use parser::BitpandaTradeParser;
pub use trade::{
Asset, AssetClass, CryptoCurrency, CsvOption, Currency, Fiat, InOut, Metal, Trade,
TransactionType,
};