JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q36624F
  • License Apache-2.0

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

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

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 (πŸ‡«πŸ‡· Feuille de marque)
  • recapFile is 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 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