Package Exports
- stats-fr-emarque-basketball-extractor
- stats-fr-emarque-basketball-extractor/index.js
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 (stats-fr-emarque-basketball-extractor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π French Stats Basketball Extractor
A tool to extract french basketball amateur matches stats from E-Marque (French Basketball Federation software)
Installation
npm install stats-fr-emarque-basketball-extractorThis 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-fraOSX
brew install imagemagick ghostscript xpdf tesseract tesseract-langHow 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 :
matchFileis the match sheet file path (π«π· Feuille de marque)recapFileis the summary sheet file path (π«π· RΓ©capitulatif)shootPositionsFile(optional) extract approximate shoot positions sheet file path (π«π· Positions de tir)historyFile(optional) is the history sheet file path (π«π· 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 testYou 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