fideparser


Namefideparser JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/erral/fideparser
SummaryA package to export tournament info from FIDE site
upload_time2024-09-03 14:29:39
maintainerNone
docs_urlNone
authorMikel Larreategi
requires_pythonNone
licenseGPL
keywords fide rating export
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            fideparser
===========

.. image:: https://img.shields.io/pypi/v/fideparser.svg
        :target: https://pypi.python.org/pypi/fideparser

.. image:: https://travis-ci.com/erral/fideparser.svg?branch=master
        :target: https://travis-ci.com/erral/fideparser

.. image:: https://coveralls.io/repos/github/erral/fideparser/badge.svg?branch=master
        :target: https://coveralls.io/github/erral/fideparser?branch=master

.. image:: https://img.shields.io/pypi/pyversions/fideparser.svg
        :alt: PyPI - Python Version



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
===================

Install using pip::

  $ pip install fideparser


And to upgrade to a newer version, just use pip again::

  $ pip install --upgrade fideparser


Use
======

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

  $ export_fide_tournaments -h

Examples
==========

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

  $ 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::

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

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

  $ 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::

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

If you want to export more arbiter data, append the optional flag `--arbiter-data`::

  $ export_fide_tournaments ESP 2013-01-01 2013-january-spain.csv csv --arbiter-data

If you want to export the report data (currently only the number of players present
in the tournament report), append the optional flag `--report-data`::

  $ export_fide_tournaments ESP 2013-01-01 2013-january-spain.csv csv --report-data

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::

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

Author
========

Mikel Larreategi <larreategi@eibar.org>

FIDE International Arbiter and python developer

.. _`FIDE Ratings website`: http://ratings.fide.com
.. _`screen-scrapping`: https://en.wikipedia.org/wiki/Web_scraping
.. _`the issue tracker in GitHub`: https://github.com/erral/fideparser/issues
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _BeautifulSoup4: http://www.crummy.com/software/BeautifulSoup/

Changelog
===========

1.1 (2024-09-03)
----------------

- Fixes for HTML changes in FIDE site.
  [erral]


1.0.2 (2019-01-10)
------------------

- More tests
  [erral]


1.0.1 (2019-01-03)
------------------

- Use unicodecsv library to produce CSV files.
  [erral]


1.0 (2019-01-03)
----------------

- Python 3 support 
  [erral]

- Minimal test setup using travis-ci
  [erral]
 


0.8.1 (2019-01-03)
------------------

- Fix player count when parsing report data.
  [erral]


0.8 (2019-01-02)
----------------

- Use HTTPS for FIDE urls.
  [erral]

- Format code using black.
  [erral]

0.7.1 (2018-01-07)
------------------

- Document optional flags
  [erral]

- Fix error when no arbiter data is present
  [erral] 


0.7 (2018-01-07)
----------------

- Condition export of report data (player count present in report)
  [erral]

- Condition export of arbiter data
  [erral]


0.6 (2018-01-06)
----------------

- Use http
  [erral]


- Remove setup.cfg
  [erral]


0.5 (2018-01-06)
----------------

- Minor fixes
  [erral]

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]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/erral/fideparser",
    "name": "fideparser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "fide rating export",
    "author": "Mikel Larreategi",
    "author_email": "larreategi@eibar.org",
    "download_url": "https://files.pythonhosted.org/packages/52/e5/14d8d81767119f785a380fc6583d259cd30dda97e0b6185b4070ccb5deea/fideparser-1.1.tar.gz",
    "platform": null,
    "description": "fideparser\n===========\n\n.. image:: https://img.shields.io/pypi/v/fideparser.svg\n        :target: https://pypi.python.org/pypi/fideparser\n\n.. image:: https://travis-ci.com/erral/fideparser.svg?branch=master\n        :target: https://travis-ci.com/erral/fideparser\n\n.. image:: https://coveralls.io/repos/github/erral/fideparser/badge.svg?branch=master\n        :target: https://coveralls.io/github/erral/fideparser?branch=master\n\n.. image:: https://img.shields.io/pypi/pyversions/fideparser.svg\n        :alt: PyPI - Python Version\n\n\n\nfideparser is a script to parse `FIDE Ratings website`_ and export the data\nof the rated tournaments.\n\nFIDE (*Federation International des Echecs* or *World Chess Federation*) is the\ninternationally recognised governing body of chess. Every month a lot of\ntournaments are played all over the world and many of them are rated for\nthe FIDE Rating List which is published on 1st day of each month.\n\nFIDE publishes all the rating reports of those rated chess tournaments online at\nhttp://ratings.fide.com but they don't provide any API or automatized way\nof exporting or getting that information.\n\nSo this script allows you to export all the data of those tournaments (based\non country and rating period) to CSV, JSON and an internal pickle-based format.\nThis script doesn't export the player data from each tournament, but the\nmetadata about the tournament: name, start- and end-dates, format, player number,\narbiter and organizer name, ...\n\nThis scripts relies on `screen-scrapping`_ so if FIDE changes the HTML\nthe script will break :S\n\nI intend to mantain this script at least once a year to export data of the\nprevious year, so I will keep an eye on the FIDE site and try to fix the bugs.\n\nFeel free to fork and ask for pull-requests. If you find any issue, use\n`the issue tracker in GitHub`_.\n\nDependencies\n==============\n\nThis script depends on BeautifulSoup4_ an excelent HTML parser used, among other\nthings, for doing screen-scrapping tasks. The scripts pulls the correct version\nof BeautifulSoup4_ so there's no need to do anything on your side to install it.\n\n\nInstallation\n===================\n\nInstall using pip::\n\n  $ pip install fideparser\n\n\nAnd to upgrade to a newer version, just use pip again::\n\n  $ pip install --upgrade fideparser\n\n\nUse\n======\n\nAll options are explained in the help, that you can get running this::\n\n  $ export_fide_tournaments -h\n\nExamples\n==========\n\nExport all data from spanish tournaments rated on January 2013 in csv format::\n\n  $ export_fide_tournaments ESP 2013-01-01 2013-january-spain.csv csv\n\nExport all data from french tournaments rated on July 2013 in binary format::\n\n  $ export_fide_tournaments FRA 2012-07-01 2012-july.binary binary\n\nUse the previously exported binary file from France, to create a JSON file::\n\n  $ export_fide_tournaments FRA 2012-07-01 2012-july.json json --datafile 2012-july.binary\n\nUse the previously exported binary file from France, to create a csv file::\n\n  $ export_fide_tournaments FRA 2012-07-01 2012-july.csv csv --datafile 2012-july.binary\n\nIf you want to export more arbiter data, append the optional flag `--arbiter-data`::\n\n  $ export_fide_tournaments ESP 2013-01-01 2013-january-spain.csv csv --arbiter-data\n\nIf you want to export the report data (currently only the number of players present\nin the tournament report), append the optional flag `--report-data`::\n\n  $ export_fide_tournaments ESP 2013-01-01 2013-january-spain.csv csv --report-data\n\nA script for merging CSV files is also provided, usefull to merge files generated\nby export_fide_tournaments script. It can be used as follows::\n\n  $ merge_csv_files outfile.csv 2013-january-spain.csv 2012-july.csv\n\nAuthor\n========\n\nMikel Larreategi <larreategi@eibar.org>\n\nFIDE International Arbiter and python developer\n\n.. _`FIDE Ratings website`: http://ratings.fide.com\n.. _`screen-scrapping`: https://en.wikipedia.org/wiki/Web_scraping\n.. _`the issue tracker in GitHub`: https://github.com/erral/fideparser/issues\n.. _virtualenv: http://pypi.python.org/pypi/virtualenv\n.. _BeautifulSoup4: http://www.crummy.com/software/BeautifulSoup/\n\nChangelog\n===========\n\n1.1 (2024-09-03)\n----------------\n\n- Fixes for HTML changes in FIDE site.\n  [erral]\n\n\n1.0.2 (2019-01-10)\n------------------\n\n- More tests\n  [erral]\n\n\n1.0.1 (2019-01-03)\n------------------\n\n- Use unicodecsv library to produce CSV files.\n  [erral]\n\n\n1.0 (2019-01-03)\n----------------\n\n- Python 3 support \n  [erral]\n\n- Minimal test setup using travis-ci\n  [erral]\n \n\n\n0.8.1 (2019-01-03)\n------------------\n\n- Fix player count when parsing report data.\n  [erral]\n\n\n0.8 (2019-01-02)\n----------------\n\n- Use HTTPS for FIDE urls.\n  [erral]\n\n- Format code using black.\n  [erral]\n\n0.7.1 (2018-01-07)\n------------------\n\n- Document optional flags\n  [erral]\n\n- Fix error when no arbiter data is present\n  [erral] \n\n\n0.7 (2018-01-07)\n----------------\n\n- Condition export of report data (player count present in report)\n  [erral]\n\n- Condition export of arbiter data\n  [erral]\n\n\n0.6 (2018-01-06)\n----------------\n\n- Use http\n  [erral]\n\n\n- Remove setup.cfg\n  [erral]\n\n\n0.5 (2018-01-06)\n----------------\n\n- Minor fixes\n  [erral]\n\n0.4.1 (2014-01-01)\n--------------------\n\n- Fix history [erral]\n\n0.4 - (2014-01-01)\n--------------------\n\n- Handle situations when the given arbiter\n  has not valid information in FIDE site [erral]\n\n0.3 - (2013-01-08)\n---------------------\n\n- Avoid duplicated headers in exported csv file [erral]\n\n- Fix arbiter parsing: previously some organizers were\n  parsed like arbiters. Fixes #1 [erral]\n\n0.2 - (2013-01-06)\n-------------------\n\n- Added a CSV file merging utlity [erral]\n\n- Improve documentation [erral]\n\n0.1 - (2013-01-06)\n-------------------\n\n- Initial release [erral]\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "A package to export tournament info from FIDE site",
    "version": "1.1",
    "project_urls": {
        "Homepage": "https://github.com/erral/fideparser"
    },
    "split_keywords": [
        "fide",
        "rating",
        "export"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b51233fc0fbb50b0660d00cd605ba7067c09b0840723a57a16b0dcc7b275d074",
                "md5": "2b36c7893072e51a4ea34020fc0e6b68",
                "sha256": "0c92ac02abb0acccd7d4fc47c6d4ff4f56da6ce54a7d6e750dbe8e242ba2864a"
            },
            "downloads": -1,
            "filename": "fideparser-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2b36c7893072e51a4ea34020fc0e6b68",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9881,
            "upload_time": "2024-09-03T14:29:37",
            "upload_time_iso_8601": "2024-09-03T14:29:37.537826Z",
            "url": "https://files.pythonhosted.org/packages/b5/12/33fc0fbb50b0660d00cd605ba7067c09b0840723a57a16b0dcc7b275d074/fideparser-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52e514d8d81767119f785a380fc6583d259cd30dda97e0b6185b4070ccb5deea",
                "md5": "98a1ba1477d91f8dd517978c66dd59c4",
                "sha256": "4e21ce17e4c6a675a926cd07ba694b15c2907bcb463bc3118e938063932adda9"
            },
            "downloads": -1,
            "filename": "fideparser-1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "98a1ba1477d91f8dd517978c66dd59c4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 85933,
            "upload_time": "2024-09-03T14:29:39",
            "upload_time_iso_8601": "2024-09-03T14:29:39.526910Z",
            "url": "https://files.pythonhosted.org/packages/52/e5/14d8d81767119f785a380fc6583d259cd30dda97e0b6185b4070ccb5deea/fideparser-1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-03 14:29:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "erral",
    "github_project": "fideparser",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": true,
    "lcname": "fideparser"
}
        
Elapsed time: 0.70479s