JSPM

  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q78119F
  • License MIT

Sorts double-entry bookkeeping CSV coming from internet banking

Package Exports

  • csv-sort

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (csv-sort) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

csv-sort

Standard JavaScript

Sorts double-entry CSVs coming from internet banking statements (and accounting, in general)

Link to npm page Build Status Coverage Status bitHound Score bitHound Dependencies bitHound Dev Dependencies Known Vulnerabilities Downloads/Month View dependencies as 2D chart

Table of Contents

Install

$ npm i -S csv-sort

Other siblings of this package:

⬆  back to top

TLDR;

csv-sort can correct the order of rows of any accounting CSV files that come in double entry bookkeeping format:

double bookkeeping example

Currently (late 2017) Lloyds Bank website exports CSV files with some rows from the same day in a wrong order. This library is my attempt to to fix such CSV's.

⬆  back to top

This lib does two twings:

  • Sorts rows in correct order that follows the double-entry format.
  • Trims the empty columns and rows (so-called 2D-Trim^).

2D trim of a CSV contents

In later releases I would like to be able to recognise and fix any offset columns caused by misinterpreted commas as values.

^ 1D-Trim would be trim of a string. 3D-Trim would be some sort of spatial data trim.

⬆  back to top

Usage

const csvSort = require('csv-sort')
// ...

⬆  back to top

API

  • Input - string
  • Output - plain object:
output object Type Description
{
res Array Array of arrays, each containing a column's value.
msgContent String This application outputs the messages here.
msgType String Can be either alert or info. That's similar to an icon on the hypothetical UI.
}

If the input is anything else than a string, it will throw. If the input is an empty string, the output object's res key will be equal to [['']].

⬆  back to top

Contributing

I promise to merge pull requests as soon as possible and to be supportive and positive to all collaborators, including JS newbies.

  • Now, you have to promise to stick to Standard JavaScript and to write unit tests for your features.
  • If you are raising an issue regarding a bug, you have to promise to describe it so that I can recreate it.

I also gladly accept feature requests – chuck them in as issues.

I also gladly accept all constructive critique regarding the code inefficiencies. This has never happened yet, but I know the time will come one day when somebody will actually take time to analyse my code, look for its deficiencies and let me know about that.

⬆  back to top

Licence

MIT License (MIT)

Copyright (c) 2017 Codsen Ltd, Roy Revelt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.