Saravanan666/pypi-org huggingface dataset:
Package: pgn2gif
Pgn2gifCreate GIFs from PGNsUsageRun./pgn2gifwith the following options:Usage: pgn2gif [OPTIONS] COMMAND [ARGS]...

  Create GIFs from PGNs

Options:
  -p, --path TEXT                 path to the pgn file/folder
  -s, --speed FLOAT               speed with which pieces move in gif.
  -o, --out TEXT                  name of the output folder
  -si, --size INTEGER             size of the gif
  -c, --color [green|blue|brown]  color of chess board
  -g, --game-index INTEGER        index of the game for which gif is to be
                                  made
  --all-games                     make gif of all the games found in a PGN
  --help                          Show help screen.

Commands:
  chess_com  Get games played on chess.com
  lichess    Get games played on lichessYou can also run./pgn2gifwithout any external options and in that case./pgn2gifwill run on the following default values:* path          current working directory
* speed         0.5
* out           folder name `gifs` in current working directory
* size          480 X 480
* color         Brown
* game-index    1stExamples./pgn2gif./pgn2gif -c blue./pgn2gif  -c green./pgn2gif -p /home/mzfr/dev/mzfr.pgn./pgn2gif -p /home/mzfr/dev/mzfr-1.pgn -s 0.2./pgn2gif  -si 600 -s 0.1./pgn2gif  -si 680InstallationYou'll need Python3.Clone the repositorygit clone https://github.com/mzfr/pgn2gifRunpip install -r requirements.txt
Package: pgn2neo4j
pgn2neo4jConvert a series of chess games in a PGN file to a Neo4j database.The database contains Position nodes representing a board position, and Move relationships representing a move from one position to another.Each Position node has a fen property containing the FEN representation of the position. Additionally, each node contains the following properties:whiteWins: the number of games won by white from this positionblackWins: the number of games won by black from this positiongamesPlayed: the total number of games played from this position
Package: pgn-downloader
pgn-downloaderpgn-downloaderis a CLI tool to download chess games fromLichessorchess.com.It provides filters to specify playing color, date range and playing mode.Installationpgn-downloaderrequires Python >=3.6.It can then installed withpip:pip install --upgrade pgn-downloaderWith this the tool can started with either:pgn-downloader server username
python -m pgn_downloader server usernameUsageusage: pgn-downloader [-h] [-c {white,black}] [--since SINCE] [--until UNTIL] [--mode MODE] [-o OUTPUT] [--version] {chess.com,lichess} username

positional arguments:
  {chess.com,lichess}   Server to download games from
  username              Username on chosen server

optional arguments:
  -h, --help            show this help message and exit
  -c {white,black}, --color {white,black}
                        Color (white/black) (default: both)
  --since SINCE         Download games since (default: account creation)
  --until UNTIL         Download games until (default: now)
  --mode MODE           Game mode which will be downloaded. Comma separated list (default: blitz,rapid,classical,correspondence)
  -o OUTPUT, --output OUTPUT
                        Output filename (default: server_username-color.pgn)
  --version             show program's version number and exitGames can be downloaded from either chess.com or lichess.org.
If desired the download can be restricted to a certain color, time control and date range.The time control is specified as a comma-seperated list, with the defaultblitz,rapid,classical,correspondence.
The possible values are:for Lichess:ultraBullet,bullet,blitz,rapid,classical,correspondence,chess960,crazyhouse,antichess,atomic,horde,kingOfTheHill,racingKings,threeCheckfor chess.com:correspondence,rapid,blitz,bulletThe date ranges can be selected with the flags--sinceand--until.
They accept either absolute or relative time ranges:absolute:YYYY,YYYY-MMorYYYY-MM-DDrelative: number with suffixyfor years,mfor months,dfor days orhfor hours.All dates specified with--sinceare interpreted as the earliest possible, while--untildates are interpreted as the latest possible (see examples)·
All dates are taken in local time.Examples:absolute:--since 2021: games since Jan 1 2021--since 2019 --until 2020: games between Jan 1 2019 until Dec 31 2020--since 2018-05-04 --until 2019-07games between May 4 2018 until July 31 2019relative as executed on 2021-06-04 16:30--since 3m: games since Mar 1 2021--since 0d: games from today--since 1d: games since June 3 2021--until 3m: games until Mar 31 2021ContributingIf you encounter any problems or have suggestions for improvements feel free to open an issue or contact the authors.
Package: pgn-filter
pgn-filterA small program to query for games inside PGN documents.You can supply basic queries using command line arguments
and you can write more advanced queries using python scripts.Example queriesGames starting with d4fromchessimportMovedefquery(game):first_move=list(game.mainline_moves())iffirst_move[0]==Move.from_uci("d2d4"):returnTruereturnFalseGames with no castling movesfromchessimportBoarddefquery(game):board=Board()formoveingame.mainline_moves():ifboard.is_castling(move):returnFalsereturnTrueInstallation instructionspipinstallpgn-filterProgram usageusage: pgn-filter [-h] [-f FILE] [-i] [-q QUERY] [-m rating] [-M rating] [-a rating] [-F] [-S]

A small program to query for games inside PGN documents

options:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  The PGN file to search through
  -i, --stdin           Read from STDIN
  -q QUERY, --query QUERY
                        The Python file containing the query to use
  -m rating, --minimum-rating rating
                        The minimum rating of games to consider
  -M rating, --maximum-rating rating
                        The maximum rating of games to consider
  -a rating, --average-rating rating
                        The rating range to consider
  -F, --fast            Only consider bullet games
  -S, --slow            Only consider blitz games and slower

Every month I look through some ten thousand games ~ Vladimir Kramnik
Package: pgnhelper
PgnHelperAn application that can sort games in pgn file; add eco codes, opening and variation names; generates round-robin, swiss and standing tables based from the given pgn file. It supports calculation of rating change and tie-break systems (Direct encounter, Number of wins, Sonneborn-Berger and Koya system) for round-robin and Buchholz cut 1, Buchholz, Sonneborn-Berger, and Direct Encounter for swiss. See the documentation for more informations.85th Tata Steel Masters, 2023pgnhelperroundrobin--inpgnfntatamast23.pgn--outputtatamast23_my.htmlInstallationpip install pgnhelper -UDocumentationRead the Docs documentation of pgnhelpercontains installation guide, features and others.LinksPypi pgnhelperReadthedocs pgnhelperCreditsPython chesssite:https://python-chess.readthedocs.io/en/latest/usage:adding ecoround-robin result table generationpgn-extractsite:https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/usage:The eco.pgn in eco folder is based from the eco.pgn from pgn-extract.cleaning pgn filesweekinchesssite:https://theweekinchess.com/usage:game collectionspgn mentorsite:https://www.pgnmentor.com/files.htmlusage:game collectionsmark weekssite:https://www.mark-weeks.com/chess/wcc-indx.htmusage:game collectionspandassite:https://pandas.pydata.org/usage:round-robin result table generation
Package: pg_ninja
pg_ninja is a tool for replicating from MySQL to PostgreSQL compatible with Python 3.3+.
The system use the library mysql-replication to pull the row images from MySQL which are transformed into a jsonb object.
A pl/pgsql function decodes the jsonb and replays the changes into the PostgreSQL database.The tool requires an  initial replica setup which pulls the data from MySQL in read only mode.
This is done by the tool running FLUSH TABLE WITH READ LOCK;  .pg_ninja can pull the data from a cascading replica when the MySQL slave is configured with log-slave-updates.The tool supports real time obfuscation.
Package: pgnotify
pgnotify: A python library to easily LISTEN to PostgreSQL NOTIFY notificationsExampleLISTEN to and process NOTIFY events with a simpleforloop, like so:frompgnotifyimportawait_pg_notificationsfornotificationinawait_pg_notifications('postgresql:///example',['channel1','channel2']):print(notification.channel)print(notification.payload)InstallInstallable with any python package manager from the python package index, eg:pipinstallpgnotifyAll the bells and whistlesYou can also handle timeouts and signals, as in this more fully-fleshed example:importsignalfrompgnotifyimportawait_pg_notifications,get_dbapi_connection# the first parameter of the await_pg_notifications# loop is a dbapi connection in autocommit modeCONNECT="postgresql:///example"# use this convenient method to create the right connection# from a database URLe=get_dbapi_connection(CONNECT)SIGNALS_TO_HANDLE=[signal.SIGINT,signal.SIGTERM]forninawait_pg_notifications(e,["hello","hello2"],timeout=10,yield_on_timeout=True,handle_signals=SIGNALS_TO_HANDLE,):# the integer code of the signal is yielded on each# occurrence of a handled signalifisinstance(n,int):sig=signal.Signals(n)print(f"handling{sig.name}, stopping")break# the `yield_on_timeout` option makes the# loop yield `None` on timeoutelifnisNone:print("timeout, continuing")# handle the actual notify occurrences hereelse:print((n.pid,n.channel,n.payload))Further documentation to come.
Package: pgnotify-u
pgnotify_u: Updated pgnotify module. A python library to easily LISTEN and NOTIFY with PostgreSQL notifications systemExampleLISTEN to and process NOTIFY events with a simpleforloop, like so:frompgnotifyimportawait_pg_notificationsfornotificationinawait_pg_notifications('postgresql:///example',['channel1','channel2']):print(notification.channel)print(notification.payload)Example2NOTIFY to:frompgnotifyimportpg_notifypg_notify("postgresql:///example",'channel1','hello')InstallInstallable with any python package manager from the python package index, eg:pipinstallpgnotify_uAll the bells and whistlesYou can also handle timeouts and signals, as in this more fully-fleshed example:importsignalfrompgnotifyimportawait_pg_notifications,get_dbapi_connection# the first parameter of the await_pg_notifications# loop is a dbapi connection in autocommit modeCONNECT="postgresql:///example"# use this convenient method to create the right connection# from a database URLe=get_dbapi_connection(CONNECT)SIGNALS_TO_HANDLE=[signal.SIGINT,signal.SIGTERM]forninawait_pg_notifications(e,["hello","hello2"],timeout=10,yield_on_timeout=True,handle_signals=SIGNALS_TO_HANDLE,):# the integer code of the signal is yielded on each# occurrence of a handled signalifisinstance(n,int):sig=signal.Signals(n)print(f"handling{sig.name}, stopping")break# the `yield_on_timeout` option makes the# loop yield `None` on timeoutelifnisNone:print("timeout, continuing")# handle the actual notify occurrences hereelse:print((n.pid,n.channel,n.payload))Further documentation to come.
Package: pg-notify-webhook
pg-notify-webhookImplements a simple server process that listens to Postgres notifications, then fires off a webhook in response.The content of the message is sent as the JSON payload to the webhook.You can use this to invoke AWS Lambda functions (fronted by API gateway) or any other system that receives HTTP requests.Install it as follows:pip install pg-notify-webhookYou simply set up aconfig.yamlwith the database connection string and define one or more channels and webhooks. Then start the server as follows:pg-notify-webhookOnce the server is running, you can send notifications from Postgres:NOTIFY one, '{"name": "Vijay"}'config.yamlDSN:postgresql://user:password@hostname:5432/databasechannels:-one-twowebhooks:one:https://postman-echo.com/get?foo1=bar1&foo2=bar2two:https://example.com
Package: pgnparser
A simple python PGN parser.PGN (Portable Game Notation) is computer-processible format for recording chess
games, both the moves and related data.This module is based on features of others python parser modules (such json and
yaml). The basic usage:import pgn

pgn_text = open('morphy.pgn).read()
pgn_game = pgn.PGNGame()

print pgn.loads(pgn_text) # Returns a list of PGNGame
print pgn.dumps(pgn_game) # Returns a string with a pgn gameFeatures:Required tags: “Event”, “Site”, “Date”, “Round”, “White”, “Black”, and
“Result”.Optional tags: “Annotator”, “PlyCount”, “TimeControl”, “Time”, “Termination”,
“Mode”, and “FEN”.Commentaries: “;” (a comment that continues to the end of the line) and
“{” (which continues until a matching “}”). The last one just in
moves list.PGN example:[Event "F/S Return Match"]
[Site "Belgrade, Serbia Yugoslavia|JUG"]
[Date "1992.11.04"]
[Round "29"]
[White "Fischer, Robert J."]
[Black "Spassky, Boris V."]
[Result "1/2-1/2"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} 3... a6
4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8  10. d4 Nbd7
11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5
Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6
23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5
hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5
35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6
Nf2 42. g4 Bd3 43. Re6 1/2-1/2
Package: pgn-parser
PGN ParserA Python library for parsing pgn files into a python friendly format.The parser is built usingcanopy, the rest is Python.The PGN spec is based on (and thanks to) the spec atsaremba.de.SetupInstallingMake sure you have python 3 installed.pip install pgn_parserThen import like so:from pgn_parser import pgn, parserTestingThe tests are written using pytest and behave, these must be installed first:pip install pytest behaveFor running unit tests:pytestFor running behavioural tests:behaveBuilding pip distributablesmake buildUsingParsing a pgn fileTo parse a pgn, you just give the string to the parser.parse along with the Actions()
which the parser uses to create python structures.>>>frompgn_parserimportparser,pgn>>>game=parser.parse("1. e4 e5",actions=pgn.Actions())>>>print(game.move(1))1.e4e5>>>print(game.move(1).black.san)e5GamesAfter parsing a game, it will be structured into the following classes which are
nested in eachother:Game: Container for the whole game
To get a specific move (5 here) from a gamegame.move(5)To retrieve the Movetextgame.movetextTo access the TagPairsgame.tag_pairsTo access the final scoregame.scoreMovetext: The container of all the moves, e.g "1. c4 c5 2. e4 e5"
It is just a list so can be iterated over to retrieve the moves.
Be warned, Movetext[0] will be the first move parsed, whether 1. or 31. so
use Game.move() if you want a movenumberMove: A move is a move number, optionally a white Ply and or a black PlyPly: Is the unit of moving, in standard algebraic notation (SAN),
e.g. the black ply from "1.e4 e5" is e5TagPairs: An ordered dictionary of all TagPair objects.
These are ordered so it keeps the order read in, but will change to
seven tag roster order if printed/stringified.TagPairsTo store meta data about a game you do so in TagPairsThe header of a pgn file["Site" "github.com"]Is represented like so in pythongame.tag_pairs["Site"]=="github.com"MovesEach move has a move number and two ply's, white and black.
Each ply can be anything from empty to having comments, variations andnags.moves = "1. e4 $1 {a comment} (1.d5)"Is represented like so:m1=game.move(1)assertm1.white.san=="e4"assertm1.white.comment=="a comment"assertm1.white.nags[0]=="$1"assertm1.white.variations[0].move(1).white.san=="d5"If a ply is empty, then its san will be represented "".LimitationsNo support for RAV style variations
No support for multiple games in one parse, must be single games
Doesn't attempt to parse turn times as this is not in the original spec and I am
not sure what to support.AuthorsBrett Bates-Initial work-githubLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: pgn-read
ContentsDescriptionInstallation InstructionsTestsNotesDescriptionThis package provides a parser for chess game scores inPGNformat.Both the strict export format and many less strict import formats are supported.Chess variants are not supported.The game module provides the Game, GameStrictPGN, GameTextPGN, and GameIgnoreCasePGN, classes and the generate_fen_for_position function.The parser module provides the PGN class and add_token_to_game function.The PGN.read_games method yields instances of the Game class, or a subclass, generated from a file-like source or string.The add_token_to_game function searches for the next PGN token in a string and applies it to an instance of the Game class, or a subclass.The generate_fen_for_position function returns the Forsyth English Notation (FEN) string for the representation of a position in the Game class, or a subclass.Installation InstructionsThis package is available on PyPI so can be installed by typingpython -m pip install –user pgn-readat the command prompt.SeePythonandpipdocumentation for alternatives and platform-specific points.TestsTests are available at therepositoryin the pgn_read.core.tests sub-package.Copy the tests directory and run tests by typing, for example,python -m pgn_read.core.tests.test_squaresat the command prompt with setup.py in the current directory.NotesProject name and package name changed from ‘pgn’ to ‘pgn-read’ prior to upload to PyPI.The version numbers of pgn-read continue on from pgn.The pgn_read.core.tests sub-package was removed from the distribution created by setup when therepositorywas created.
Package: pgn-speaker
PGN SpeakerCommand line program that speaks moves from a PGN file.This is intended to assist in visualization exercises as described inhttps://nextlevelchess.blog/improve-your-visualization/Running the programpgn-speakeris a Python program and therefore requires a Python runtime.
Instead of usingpipto get the package, it is recommended to usepipx.
This ensures you are always running the latest version ofpgn-speaker.After installingpipxrun the following command where$PGNis the path to
a PGN file saved on your computer.pipx run pgn-speaker $PGNIfpipxis not in yourPATH, you may need to run it as a module instead:python3 -m pipx ...Or if using the Python Launcher for Windows:py -3 -m pipx ...System requirementsPython >= 3.10Windows >= 10macOS >= 10.14
Package: pgnsplit
pgnsplitpgnsplitis a simple command-line application that takes a singlepgnfile (e.g. from aLichess Study) and extracts all the variations in the pgn, putting each of them in their own individual pgn files in a folder./pgn/, which can then be stored in some sort of database (e.g. in SCID or ChessX).This solves the problem in various chess software, where importing pgns only stores the mainline variation.This is presented as a lightweight and easy-to-use alternative toDavid J. Barnes' pgn-extract, which is still more appropriate for the intricate manipulation of pgn files.RequirementsPython (>3.8)pip (which normally comes with Python)Installation$pipinstallpgnsplitUsage$pgnsplit<filepath><filepath>must be the path to a properly formatted pgn file. The individual pgn files will be stored in a local folder.ImprovementsFurther improvements/functionality could be made as requested/needed.
Package: pgn-to-gif
pgn-to-gifGenerate GIFs of chess games from PGN files.Installationpip3 install pgn-to-gifUsageusage: pgn-to-gif [-h] --pgn-path PGN_PATH --gif-path GIF_PATH [--add-initial-position {1,t,true,0,f,false}] [--highlight-last-move {1,t,true,0,f,false}] [--orientation {white,black}]
              [--size SIZE] [--coordinates {1,t,true,0,f,false}] [--css-path CSS_PATH] [--loop LOOP] [--duration DURATION] [--fps FPS] [--palettesize PALETTESIZE]
              [--subrectangles {1,t,true,0,f,false}] [--processes PROCESSES]

optional arguments:
  -h, --help            show this help message and exit
  --pgn-path PGN_PATH   path to pgn file to read (default: None)
  --gif-path GIF_PATH   path to gif file to save (default: None)
  --add-initial-position {1,t,true,0,f,false}
                        add initial position to gif (default: true)
  --highlight-last-move {1,t,true,0,f,false}
                        highlight last move on board (default: true)
  --orientation {white,black}
                        orientation of board (default: white)
  --size SIZE           size of board (default: 400)
  --coordinates {1,t,true,0,f,false}
                        add board coordinates (default: true)
  --css-path CSS_PATH   path to css file to style board (default: None)
  --loop LOOP           number of loops for gif, 0 means infinite (default: 0)
  --duration DURATION   duration of each frame (in seconds) in gif (default: 1.0)
  --fps FPS             frame per second of gif (default: 1.0)
  --palettesize PALETTESIZE
                        number of colors to quantize images to (default: 64)
  --subrectangles {1,t,true,0,f,false}
                        optimize gif by storing change (default: true)
  --processes PROCESSES
                        number of processes when converting svgs to pngs (default: 1)ExamplesPlease seeexamplesfolder.
Package: pgn-to-sqlite
PGN to SqliteA cli application for pulling pgn files from Chess.com and Lichess.org and putting your games into a sqlite database.It can also be used to save pgn files from a local folder to a sqlite database.InstallRequires Python 3.8 and above.It is recommended that you install this package in a virtual or isoloated environment. The easiest way to do this is withpipx.pipxinstallpgn_to_sqliteAlternatively, you can install it with pip into your virtual environment:MacOS / Linux:python3-mpipinstallpgn_to_sqliteWindows:python-mpipinstallpgn_to_sqliteUsageUsage:pgn-to-sqlite[OPTIONS]COMMAND[ARGS]...Saveyourchessgamestoansqlitedatabase.Youcan`fetch`yourgamesfromchess.comorlichess.org.Youcanalso`save`localpgnfilestothedatabase.Type`pgn-to-sqlite--help`formoreinformation.

Options:-u,--userTEXTYouusernameforthechesssite.-o,--outputFILEWhereyouwouldlikeyourdatabasesaved?[required]--helpShowthismessageandexit.

Commands:fetchFetchallgamesfromtherequestedsite.saveFetchallpgnfilefromthegivenfolder.Fetch games from chess.com or lichess.orgusernameandoutputare required when usingfetchto download, parse, and save your games to your database.fetchaccepts withchessorlichessas an argument forchess.comandlichess.orgrespectively.Example:pgn-to-sqlite-uendlesstrax-odata.dbfetchlichessIf you've played a lot of games,be patient, it could take a minute or two.Save games from local folderoutputis required when saving games from local pgn files to your database.saveexpects a folder path as an argument.Example:pgn-to-sqlite-odata.dbsave.\chess\games\Feedback and ContributionIf you find a bug, please file anissue.If you have feature requests, pleasefile an issueand use the appropriate label.Pleaseraise an issue before making a PR, so that the issue and implementation can be discussed before you write any code. This will save you time, and increase the chances of your PR being merged without significant changes.Pleaseformat you codewithBlackandisort. I also reccomend usingruffto lint your code.Pleaseinclude testsfor any PR's that include code (unless current tests cover your code contribution).SupportIf you would like to show your support for the project you cansponsor me on Github, orbuy me a coffee. 🤓