cointracking-imports-0.1.0.2: Generate CSV & XLSX files for importing into CoinTracking.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.CoinTracking.Imports

Description

Generate CSV & XLSX files to use with CoinTracking's import feature.

Synopsis

Documentation

writeImportDataToFile :: FilePath -> [CTImportData] -> IO () Source #

Write the given data to a file. If the file extension is .xlsx or .xls, we write a spreadsheet. Otherwise we write a CSV.

Types

CSV Import Files

coinTrackingCsvImport :: [CTImportData] -> ByteString Source #

Generate the CoinTracking CSV Import for the data, prepended by a header row.

Note: the resulting ByteString has it's final newline removed, as CoinTracking's Import creates a double entry with newlines at the end of an import file.

headerRow :: ByteString Source #

The CSV header row to prepend to the generated output.

csvEncodingOptions :: EncodeOptions Source #

defaultEncodeOptions, but with newline-only line endings.

XLSX Import Files

coinTrackingXlsxImport Source #

Arguments

:: POSIXTime

Creation time to embed in the spreadsheet.

-> [CTImportData] 
-> ByteString 

Generate an XLSX file containing the expected headers rows and the import data.

writeXlsxHeader :: Worksheet -> Worksheet Source #

Write the standard CoinTracking header to the first two rows of the worksheet.

writeXlsxRow :: Worksheet -> RowIndex -> CTImportData -> Worksheet Source #

Write a CTImportData to the given row(1-indexed) of the worksheet.