Skip to main content

A package to export tournament info from FIDE site

Project description

fideparser

fideparser is a script to parse FIDE Ratings website and export the data of the rated tournaments.

FIDE (Federation International des Echecs or World Chess Federation) is the internationally recognised governing body of chess. Every month a lot of tournaments are played all over the world and many of them are rated for the FIDE Rating List which is published on 1st day of each month.

FIDE publishes all the rating reports of those rated chess tournaments online at http://ratings.fide.com but they don’t provide any API or automatized way of exporting or getting that information.

So this script allows you to export all the data of those tournaments (based on country and rating period) to CSV, JSON and an internal pickle-based format. This script doesn’t export the player data from each tournament, but the metadata about the tournament: name, start- and end-dates, format, player number, arbiter and organizer name, …

This scripts relies on screen-scrapping so if FIDE changes the HTML the script will break :S

I intend to mantain this script, at least once a year to export data of the previous year, so I will keep an eye on the FIDE site and try to fix the bugs.

Feel free to fork and ask for pull-requests. If you find any issue, use the issue tracker in GitHub.

Dependencies

This script depends on BeautifulSoup4 an excelent HTML parser used, among other things, for doing screen-scrapping tasks. The scripts pulls the correct version of BeautifulSoup4 so there’s no need to do anything on your side to install it.

Installation

The easiest way run this script is to install it in a virtualenv. So first install virtualenv (for instance, running sudo apt-get install python-virtualenv in Debian and Ubuntu systems). Then create a virtualenv somewhere in your system:

$ cd somewhere
$ virtualenv fideparser

Then, install fideparser in this virtualenv:

$ cd fideparser
$ ./bin/easy_install fideparser

If you are upgrading from a previous version of fideparser, run easy_install in upgrade mode:

$ ./bin/easy_install -U fideparser

This script has been tested with Python 2.7 in a Linux environment. Windows platform is untested and I have no plans to test it. Patches welcomed.

Use

All options are explained in the help, that you can get running this:

$ ./bin/export_fide_tournaments -h

Examples

Export all data from spanish tournaments rated on January 2013 in csv format:

$ ./bin/export_fide_tournaments ESP 2013-01-01 2013-january-spain.csv csv

Export all data from french tournaments rated on July 2013 in binary format:

$ ./bin/export_fide_tournaments FRA 2012-07-01 2012-july.binary binary

Use the previously exported binary file from France, to create a JSON file:

$ ./bin/export_fide_tournaments FRA 2012-07-01 2012-july.json json --datafile 2012-july.binary

Use the previously exported binary file from France, to create a csv file:

$ ./bin/export_fide_tournaments FRA 2012-07-01 2012-july.csv csv --datafile 2012-july.binary

A script for merging CSV files is also provided, usefull to merge files generated by export_fide_tournaments script. It can be used as follows:

$ ./bin/merge_csv_files outfile.csv 2013-january-spain.csv 2012-july.csv

Author

Mikel Larreategi <larreategi@eibar.org>

FIDE International Arbiter and python developer

Changelog

0.4.1 (2014-01-01)

  • Fix history [erral]

0.4 - (2014-01-01)

  • Handle situations when the given arbiter has not valid information in FIDE site [erral]

0.3 - (2013-01-08)

  • Avoid duplicated headers in exported csv file [erral]

  • Fix arbiter parsing: previously some organizers were parsed like arbiters. Fixes #1 [erral]

0.2 - (2013-01-06)

  • Added a CSV file merging utlity [erral]

  • Improve documentation [erral]

0.1 - (2013-01-06)

  • Initial release [erral]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fideparser-0.4.1.zip (32.6 kB view details)

Uploaded Source

File details

Details for the file fideparser-0.4.1.zip.

File metadata

  • Download URL: fideparser-0.4.1.zip
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fideparser-0.4.1.zip
Algorithm Hash digest
SHA256 7c1fb29952a354742e671bcc63de935e464e74b241e4368016c8df357032ee74
MD5 45de504fb76fa4fdfb77c12c89420c66
BLAKE2b-256 8ec8cd67ecb56c8a66149e96d7e797b01c44e39ba0ce499819fcbc4023cb975c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page