my-chesscom-stats

command module
v0.0.0-...-bf9dc68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 4 Imported by: 0

README

my-chesscom-stats

Description and motivation

This projects demonstrates fetching data from chess.com public API. Currently, it can only export played games to a CSV sheet.
I think that owning the data you produce is a healthy idea. It can also be a lot of fun to analyze it and gain insights. After having some experience of doing data analysis with Python, I guess that CSV is an appropriate choice for exporting format, that's why the support for it was implemented primarily. However, the Exporter is hidden under the interface, so any kind of storage can be supported with no pain.

Chess.com do not currently provide the API for solved tactics, which is a pity.

Example

Exporting all games played by the USERNAME to FILENAME.csv only requires this setup:

import (
    "github.com/esimonov/my-chesscom-stats/exporter"
    csv "github.com/esimonov/my-chesscom-stats/exporter/csv"
)

func main() {
    dispatcher := exporter.NewDispatcher(USERNAME)

    csvExporter, err := csv.NewExporter(FILENAME, USERNAME)
    if err != nil {
        panic(err)
	  }

    exporters := []exporter.Exporter{csvExporter}

    if err = dispatcher.AllGames(exporters); err != nil {
        panic(err)
    }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
csv

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL