lichess.org
Donate

Help with Lichess Database Search

@bufferunderrun said in #8:
> You can do this with pgn-extract: www.cs.kent.ac.uk/people/staff/djb/pgn-extract/
> with a -t flag and for example this tagfile:
>
> Opening "Sicilian"
> WhiteElo > "2000"
> BlackElo > "2000"
> Result "0-1"
>
> This will work a little bit faster than anything written in Python or JavaScript since it's C :)
>
> pgn-extract -s -t tags.txt -o out.pgn --maxmoves 30 lichess.pgn
>
> See full description link there for explanations and examples.
>
> There is also database.nikonoel.fr with already filtered games. Could be easier to process if your search criteria are similar. Though I don't think Opening tags are included, so you would need to either filter out by ECO or do ECO classification (can do with pgn-extract and its eco.pgn).
> Also see TSV (tab-separated values) files github.com/lichess-org/chess-openings if you want to create your own eco.pgn based on Lichess names. Bear in mind that the names might have changed over time.

Can this also work with directly the pgn.zst files without uncompressing?
#10:
Possibly with FENPattern match, but I just use SCIDvsPC for this stuff. It's more convenient.
There is also CQL: http://www.gadycosteff.com/cql/
SCIDvsPC comes with CQL 5.2 support.

#11:
It's easy on Linux. You just zstdcat and pipe into pgn-extract. For example:
zstdcat lichess.pgn.zst | pgn-extract -s -t tags.txt -o out.pgn

On Windows, as I don't have a Windows box available, I'm not sure what PeaZip command line flags look like. Or what Facebook's Windows build github.com/facebook/zstd/releases can do. If you can output the PGN to standard output, then you just pipe to to pgn-extract.

This topic has been archived and can no longer be replied to.