1.0.2 • Published 2 years ago

stats-fr-emarque-basketball-extractor v1.0.2

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
2 years ago

:basketball: French Stats Basketball Extractor

NPM version NPM total downloads travis-ci

A tool to extract french basketball amateur matches stats from E-Marque (French Basketball Federation software)

Installation

npm install stats-fr-emarque-basketball-extractor

This package use pdf-image and node-ts-ocr packages, which need convert, gs, pdfinfo, pdftotext and tesseract commands.

Ubuntu

sudo apt-get install imagemagick ghostscript poppler-utils tesseract-ocr tesseract-ocr-fra

OSX

brew install imagemagick ghostscript xpdf tesseract tesseract-lang

How to use

Extractor = require('stats-fr-emarque-basketball-extractor');

Get all stats from match PDF files

Extractor.extractAll(matchFile, recapFile, shootPositionsFile, historyFile).then((result) => {
  // TODO something with result object
});

French E-Marque software provide four PDF files which could be used :

  • matchFile is the match sheet file path (:fr: Feuille de marque)
  • recapFile is the summary sheet file path (:fr: Récapitulatif)
  • shootPositionsFile (optional) extract approximate shoot positions sheet file path (:fr: Positions de tir)
  • historyFile (optional) is the history sheet file path (:fr: Historique)

Get stats from match sheet

Extractor.extractMatchSheet(matchFile).then((match) => {
  // TODO something with match object
});

Get stats from summary sheet

Extractor.extractRecap(recapFile).then((match) => {
  // TODO something with match object
});

Get stats from history sheet

Extractor.extractHistory(historyFile).then((history) => {
  // TODO something with history events array
});

Get stats from shoot positions sheet

Extractor.extractMatchSheet(shootPositionsFile, slowMode).then((positions) => {
  // TODO something with positions array
});

Get file type

Extractor.checkFile(file).then((result) => {
  // MATCH_SHEET, RECAP, HISTORY, SHOOT_POSITIONS or null depending the file type
});

A temp directory (called tmp-extractor) is created and deleted during this method to process images of shoot positions.

Tests

git clone https://github.com/AntoineBouquet/stats-fr-emarque-basketball-extractor.git

npm run test

You can put your own match files in tests/matchs/1 and/or and tests/matchs/2 with determined names (e.g match-sheet.pdf, recap.pdf, history.pdf, shoot-positions.pdf)

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.5.2

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.10

3 years ago

0.4.7

3 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.6

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago