This is the PDF and PP-CSV Import used on tresor.one
npm install @tresor.one/importimport getActivities from '@tresor.one/import';
async fileHandler() {
const results = await Promise.all(Array.from(this.$refs.myFiles.files).map(getActivities));
results.forEach(result => {
console.log(result);
});
}The function getActivities returns an objects with the following fields:
| Name | Description |
|---|---|
| file | The file name of the input file. |
| activities | All activity which was parsed from the input file. |
| status | The status code which contains the information about the reason why no activities was found. For Details see the status table. |
| successful | The simple way to check if at least one activity was found and the status code is equals zero. |
The status field can contains one of the following values:
| Status-Code | Description |
|---|---|
| 0 | All pages can parsed each with one or more activities |
| 1 | Unable to identifiy an implementation with the content of the first page |
| 2 | More than one implementation was found for the first page |
| 4 | Unable to parse given file type |
| 5 | No activities found for a valid document |
To contribute:
- fork the repo
- install and start
npm i && npm start - open the logged URL, usually
http://localhost:5000, in your browser - Import a PDF. Content is shown in your Javascript console
- Write a parser in
src/brokersto parse that content - seesrc/brokers/comdirect.jsfor inspiration - Add and run all tests
npm t - Create a Pull Request