Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Generate CSV & XLSX files to use with CoinTracking's import feature.
Synopsis
- writeImportDataToFile :: FilePath -> [CTImportData] -> IO ()
- module Web.CoinTracking.Imports.Types
- coinTrackingCsvImport :: [CTImportData] -> ByteString
- headerRow :: ByteString
- csvEncodingOptions :: EncodeOptions
- coinTrackingXlsxImport :: POSIXTime -> [CTImportData] -> ByteString
- writeXlsxHeader :: Worksheet -> Worksheet
- writeXlsxRow :: Worksheet -> RowIndex -> CTImportData -> Worksheet
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 #
:: 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.