Git Product home page Git Product logo

chess-elo-feda's Introduction

NAME

Chess::ELO::FEDA - Download FEDA ELO (http://www.feda.org) into differents backends (SQLite)

VERSION

version 0.04

SYNOPSIS

my $elo = Chess::ELO::FEDA->new(
   -url      => 'http://feda.org/feda2k16/wp-content/uploads/2017_11.zip'
   -folder   => './elo/feda',
   -target   => '2017_11.sqlite',
   -callback => sub { my $player = shift; },
   -verbose  => 1
);

DESCRIPTION

The main idea of this module consists on build a SQL format from the XLS downloaded from the URL provided. All players information are loaded into "elo_feda" table, according this script:

CREATE TABLE elo_feda(
   feda_id integer primary key, 
   surname varchar(32) not null,
   name    varchar(32), 
   fed     varchar(8), 
   rating  integer, 
   games   integer, 
   birth   integer, 
   title   varchar(16), 
   flag    varchar(8)
);

METHODS

new (%OPTS)

Constructor. It accepts a hash with these options:

-callback

This callback sub will be called on each record found. It receives a hash reference with the player data: feda_id, surname, name, fed, rating, games, birth, title, flag

-folder

Working folder of the overall process. It is not created if it doesn't exists.

-target

Target file where the parser stores the ELO information. According the file extension, it selects the proper backend: .sqlite for SQLite dabase or .csv for a CSV file format. An empty value means that no backend is built.

-url

The URL direction (http://) used by the downloader to search the ZIP file. The main file expected into the package is the XLS

-verbose

0 by default. If set, shows useful debug messages

cleanup

Unlink the files dowloaded for this downloader (the XLS file)

download

Download the ZIP file from the -url parameter. Extract the XLS file to the target_folder (which must exists).

parse

Parse and transform the XLS input file to the proper backend, according the -target parameter. It relies on DBD::* in order to build the file.

run

Integrates download, parse and cleanup in a single call.

AUTHOR

Miguel Prz <[email protected]>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Miguel Prz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.