Saravanan666/pypi-org huggingface dataset:
Package: cherrypy-jsonrpcserver
DEPRECATED!Usepython-jsonrpcinstead:https://pypi.python.org/pypi/python-jsonrpchttps://github.com/gerold-penz/python-jsonrpcpython-jsonrpcExample:#!/usr/bin/env python# coding: utf-8importcherrypyfrompyjsonrpc.cpimportCherryPyJsonRpc,rpcmethodclassRoot(CherryPyJsonRpc):@rpcmethoddefadd(self,a,b):"""Test method"""returna+bindex=CherryPyJsonRpc.request_handlerprint"Starting HTTP server ..."print"URL: http://localhost:8080"cherrypy.quickstart(Root())cherrypy-jsonrpcstellt CherryPy eine Klasse zum Handling von
JSON-RPC v2.0 zur Verfügung.Leitet man eine Klasse von dieser Klasse ab, werden alle mit<FunctionName>.exposed = Truegekennzeichneten Methoden dieser Klasse zu JSON-RPC-Methoden.An der Umsetzung des JSON-RPC-Servers zur Verwendung als CherryPy-Tool wird
derzeit gearbeitet.Informationen:JSON-RPC SpecificationHistorical JSON-RPC SpecificationsJSON-Schema(klingt interessant - sollte man einbauen)Beispiel:#!/usr/bin/env python# coding: utf-8importcherrypyimportcpjsonrpcserverclassJsonRpcMethods(cpjsonrpcserver.JsonRpcMethods):defhello(self,name):returnu"Hello "+namehello.exposed=Truedefmulti(self,num):returnnum*2multi.exposed=Truedefmain():cherrypy.quickstart(JsonRpcMethods(debug=True))if__name__=="__main__":main()
Package: cherrypy-psycopg2
CherryPy-Psycopg2CherryPy-Psycopg2 is a simple CherryPy Tool to manage a
(thread-safe)
pool of database connections and make them available to handlers.Importcherrypy_psycopg2to make the tool available in CherryPy's default toolbox.The following configuration settings are understood:tools.psycopg2.minconn- passed to the psycopg2 pool constructortools.psycopg2.maxconn- passed to the psycopg2 pool constructortools.psycopg2.dsn- passed to the psycopg2 pool constructortools.psycopg2.cursor_factory- passed to the psycopg2 connection's cursor() methodWhen the tool is enabled on a handler, it will collect a database connection
from the pool, expose a cursor ascherrypy.request.psycopg2_cursor,
execute the handler and then commit the transaction (if the handler was
successful or raised one of thecherrypy_psycopg2.COMMITTABLE_HANDLER_EXCEPTIONS), or rollback the
transaction if the handler raised any other exception.For example:class Root:
    @cherrypy.expose
    @cherrypy.tools.psycopg2()
    def index(self):
        cursor = cherrypy.request.psycopg2_cursor
        cursor.execute("SELECT now()")

        return cursor.fetchone()[0]
Package: cherrypyrest
A minimal framework inspired by DjangoCherrypyrest is a minimal framework that provides all basic ORM
functionalities and more such as Models, Serializers, REST API
Controllers and some basic common utilities.How to usefrom cherrypyrest import models
from cherrypyrest import fields as base_fields

class User(models.Model):

    NAME = 'name'
    EMAIL = 'email'
    AGE = 'age'

    fields = [NAME, EMAIL, AGE]

    name = base_fields.String(null=True)
    email = base_fields.Email(required=True)
    age = base_fields.Number()

user = User()
user.set_value({"name": "abc", "email": "abc@xyz.com"})
print(user.db_repr())  # db representation of object
print(user.serialize()) # json serializable form


class Address(models.Model):

    CITY = 'city'
    STATE = 'state'
    COUNTRY = 'country'
    POSTAL_CODE = 'postal_code'  # internal representation of a field
    USER = 'user'
    alias = {
          POSTAL_CODE: 'pin_code',  # external or api reppresentation of a field
    }
    fields = [CITY, STATE, COUNTRY, POSTAL_CODE, USER]

    city = base_fields.String()
    state = base_fields.String()
    country = base_fields.String()
    postal_code = base_fields.Number(required=True)
    user = base_fields.RelatedField(child=User(), required=True)


address = Address()

address.set_value({"state": "ABC", "postal_code": 12345, "user": {"email": "abc@xyz.com"}})

print(address.serialize())
#{'city': '',
# 'state': 'ABC',
# 'country': '',
# 'pin_code': 12345,   # use of alias
# 'user': {'name': None, 'email': 'abc@xyz.com', 'age': None}}You can add a lot of attributes in the model class such aspublic_fields,read_only_fieldsetc to make model response more
flexible.The model works best with MongoDB as theObjectIDfield is already
provided in the fields module. Add a properly setup manager class obejct
in the model.manager = UserManager()NOTE: Manager object should have a valid database client object to
connect to. You can conect with any database but mongodb works well
without any changes in the code.Add an attribute in the models class to identify the database fieldsdb_fieldswhich gets a list of fields that will be fetched from the
database when required. So in ourAddressclassdb_fields = [USER]and thenuser = User()
user.set_value({"email": "abc@xyz.com"})
user.save()
user_id = user.pk

address = Address()
address.set_value({"postal_code": 234325, "user": user_id})  # no call to the database
print(address.user.pk)
# $ ObjectId("23487h2i374x2748bbksjedhskf")
print(address.user.email)
# a call will be initiated to the database to fetch the user object by id and will set the whole object to the user attribute of addres objectSo a call to db will only happend when we really need the related data.I created this small package during my work on a project of one of my
previous company. I haven’t really paid a lot of attention to the design
patterns and structure but it worked for me at that time. You can update
the code according to your needs.
Package: cherwell-pydantic-api
cherwell_pydantic_apia pythonic, asyncio connector for the Cherwell CSM API with full usage of Pydantic typesThis module implements a modern, Pythonic,asynciointerface to theCherwell REST APIoffered by the Cherwell Service Management (CSM) ITSM solution.It offers both a low-level interface to each API call, as well as a high-level interface that maps Cherwell Business Objects to individualPydanticmodels. These models will be automatically generated for your Cherwell instance and maintained in a git repository. This makes it easy to track changes in business object definitions automatically.LicenseMIT LicenseCherwell Service Managementis a product and trademark ofIvanti. This project is not affiliated with Ivanti in any way.
Package: cheshire
CheshireAPI for Keepsmile and related Bluetooth LE lights.UsageThe example below scans for Bluetooth LE devices and tries to control any
which are supported.For more detailed instructions, see theuser guide.importasynciofrombleakimportBleakScanner,BleakClientfromcheshire.compiler.stateimportLightStatefromcheshire.generic.commandimport*fromcheshire.hal.devicesimportConnection,connect_to_ble_deviceasyncdefmain():# Discover Bluetooth LE devicesdiscover=awaitBleakScanner.discover()connections:list[Connection]=[]# Connect to supported devicesforbleak_deviceindiscover:ifbleak_device.name==None:continue# Connect to this device if it's one we supportifconnection:=awaitconnect_to_ble_device(bleak_device):print(f"Connected to{bleak_device.name}")connections.append(connection)asyncdefsend_all(state:LightState):# Push light state to connected devicesforcinconnections:awaitc.apply(state)# Update desired light statestate=LightState()state.update(SwitchCommand(on=True))state.update(BrightnessCommand(0x30))state.update(RGBCommand(0x0e,0x0,0xaa))# state.update(EffectCommand(Effect.JUMP_7))awaitsend_all(state)asyncio.run(main())Supported DevicesDeviceBluetooth NameSupportKeepsmile Led Strip LightsKS03-XXXXYesKeepsmile Led Strip Lights (New)KS03~XXXXYesKeepsmile Double Side Lighting Led Floor Lamp?Unknownluckystyle Floor LampKS01-XXXXUntested
Package: cheshire_cat_api
Cheshire Cat API clientAPI to develop Python clients to interact with the Cheshire Cat.The package allows instantiating aWebSocketclient and provides the API to interact with all theendpoints.A part of this Python package is automatically generated by theOpenAPI Generatorproject.For deeper documentation about the available endpoints, please refer to the APIReDoc.
The official Cheshire Cat documentation is availablehere.Requirements.Python 3.10Installation & Usagepip installYou can install the API withpip:pipinstallcheshire-cat-apiThen import the package:importcheshire_cat_apiasccatInteract with the HTTP EndpointsAvailable APIsTheCatClienthas the following attributes to easily interface with the related APis:memorypluginsrabbit_holestatusembeddersettingsllmInstantiate connectionimportcheshire_cat_apiasccat# A config is necessary to set up base parameters like# URL, port, user_id, etc.config=ccat.Config(user_id="my_user_42")# Connect to the APIcat_client=ccat.CatClient(config=config)Plugin API - Retrieve plugins# Now retrieve a list of the available pluginsplugins=cat_client.plugins.get_available_plugins()RabbitHole API - Upload a URLfromcheshire_cat_api.models.body_upload_urlimportBodyUploadUrl# Please note that interacting with the RabbitHole to upload# a URL requires structuring the body like thisbody_upload_url=BodyUploadUrl(url="https://cheshire-cat-ai.github.io/docs/conceptual/cheshire_cat/rabbit_hole/")# then you can make the request as followsresponse=cat_client.rabbit_hole.upload_url(body_upload_url)Send a WebSocket messageimporttimeimportcheshire_cat_apiasccat# A config is necessary to set up base parameters like# URL, port, user_id, etc.config=ccat.Config(user_id="my_user_42")cat_client=ccat.CatClient(config=config)# Connect to the WebSocket APIcat_client.connect_ws()whilenotcat_client.is_ws_connected:# A better handling is strongly advised to avoid an infinite looptime.sleep(1)# Send the messagecat_client.send(message="Hello Cat!")# Close connectioncat_client.close()Documentation for ConfigBoth the classes are available with:fromcheshire_cat_apiimportConfigClassNameDefaultDescriptionConfigbase_url"localhost"base URL where the Cat is hostedConfigport1865port for the connectionConfiguser_id"user"id of the clientConfigauth_key""authentication key for the http endpointsConfigsecure_connectionFalseif to use secure protocolLow-level APIFor a more advanced usage, you can directly interact with the auto-generated client.
For documentation seehere
Package: chesnut
docs|pip`Chesnut` is a lightweight tree class implementation in Python that offers a simple approach to search tree structures. By inheriting from the `Node` class, you can create your custom nodes and leverage its methods for efficient tree navigation.InstallationInstall chesnut using pip.pipinstallchesnutThen you can use theNodeclass in your project.fromchesnutimportNodeUsageCreating Custom NodesYou can subclass theNodeclass to create your custom nodes and add your own attributes and methods.classCustomNode(Node):def__init__(self,data,parent=None):super().__init__(parent=parent)self.data=dataBuilding a Tree# Creating nodesroot_node=CustomNode(data="Root")child_node1=CustomNode(data="Child 1",parent=root_node)child_node2=CustomNode(data="Child 2",parent=root_node)grandchild_node=CustomNode(data="Grandchild",parent=child_node1)Using Node AttributesFor a complete list of methods, see thedocumentation.Finding Nodes# Finding the rootroot=child_node1.root# Checking if a node is the rootis_root=root_node.is_root# TrueQuerying Nodes# Querying children by typechildren_of_type=root_node.children_by_type(CustomNode)# List of CustomNode instances# Querying descendants by typedescendants_of_type=root_node.descendants_by_type(CustomNode)# List of CustomNode instancesChecking Node Relationships# Checking if a node has children of a specific typehas_children=root_node.has_children_by_type(CustomNode)# True or False# Checking if a node has descendants of a specific typehas_descendants=root_node.has_descendants_by_type(CustomNode)# True or FalseBy using theNodeclass as a base for your custom nodes, you can take advantage of its methods to easily navigate and manipulate your tree structure. This inheritance approach allows you to focus on the specific functionality of your custom nodes while benefiting from the tree-related operations provided by chesnut.TestingYou can run the tests with:maketestCoverage can be checked at function level with:makecoverageLinting can be performed with:makelintDocumentationDocumentation is availablehere. It is generated from the docstrings usingpdoc. You can generate this yourself using:makedocsThis will generate the documentation in thedocsfolder, opendocs/index.htmlin your browser to see the documentation.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: chess-ai
Chess AIProvides a very basic chess game and AI.Very Quick TutorialTo construct a new chess board, use the Board class.>>> board = Board();To show the board, print board.>>> print(board)To locate a position, use locate().>>> locate("a3")
a3To get a piece, call the get_piece method.>>> board.get_piece(locate("a1"))
Rook("white") at a1
Package: chess-ai-pip
ChessAIAttempt to create a decent adversary to play chess against. The game implementation used for the
agents in this project is another personal projectchess_pythonRun the (very basic) GUI with:pip install chess-ai-pip
python -m chess_ai.playground.chess_guiPlanClassical engine:Create "decent" agent with alpha beta pruning and minimaxImplement Move orderingImplement transpositions (caching)Implement Iterative deepening searchThis classical engine is limited by the performance of the chess game implementation (heavily)Deep lerning agent:1. Game implementation with legal moves known and value network based on plays of DL agents2. Learned model, policy and value networkEvaluation of agent strenght:Come up with a simple strength evaluator strategy that can be used to measure progress for the DL
agent and baseline for classical engine agent.Choose an arbitrary number of positionsRun them through an engine (stockfish) and rank all posible moves (from best to worst)Compare chosen move from agent to the list of moves from the engineAssign score based on how good is the agent choice, if agent choice is more than one (same
evaluation for different positions) take the bestSum the scoreUIImportant for testing TODO:Basic UIPlay also as black inverting boardAllow args when launching the GUI (depth, agent type, fen)
Package: chessai-python
ChessAI - Chinese Chess Game AnalyzerChessAI is a groundbreaking tool that brings together computer vision, chess algorithms, and advanced analytics to revolutionize the Chinese Chess analytics landscape. With ChessAI, you don't need expensive electronic boards to analyze your games. Simply use your regular board, set up a camera to capture the position, and let ChessAI do the rest.Main source code:chesssai.Deep Learning / Data Preparation:dnn_models/data_preparation- Currenly only support for Chinese Chess (XiangQi),contact mefor the license and the source code of the data preparation tool.Deep Learning / Training:dnn_models/training.RoadmapChess position detection.Chess engine integration.Move suggestion.Deep learning model for chess board detection (No need to use ARUCO markers).Environment setupRequirements: Python 3.9,Conda, Node.js 18+.Clone this repository.gitclonehttps://github.com/vietanhdev/chessai--recursiveCreate a new conda environment and the required packages.condacreate-nchessaipython=3.9
condaactivatechessai
pipinstall-e.Install Node.js packages and build the frontend.cdchessai/frontend
npminstallcd..
bashbuild_frontend.shBuild chess engineThis project usesgodogpawas the chess engine.InstallGo.Build the engine.cdgodogpaw
gobuildCopy the executable file (godogpaw*) to the./data/enginesfolder.Run the appENGINE_PATH="data/engines/godogpaw-macos-arm"python-mchessai.app--run_appReplaceENGINE_PATHwith the path to the chess engine executable file.Data preparation & TrainingThis project uses computer vision and deep learning to detect chess pieces and chess board position.AI flow for chess position detection:Go todnn_modelsfolder and follow the instructions in theREADME.mdfile to prepare the data and train the model.ReferencesThis project was initially built forHackster's OpenCV AI Competition 2023. Hackster Project:ChessAI - Chinese Chess Game Analyzer.Object detection model (for chess pieces) is based onYOLOX- License: Apache 2.0.Chess engine:godogpaw- License: MIT.UI components:shadcn-ui- License: MIT.
Package: chess-analytica
IntroductionChess-Analyticais a chess library that allows for the simple scraping of data using the chess.com API, and subsequent
analysis of that data.  Built on top of the python-chess library, Chess-Analytica allows for you to easily scrape
all of a given player’s past (or current) games, filter the games down, and then analyze them.fromchess_analyticaimportBoard,ChessDotComprofile=ChessDotCom.Profile("aronfrish",False)profile.filterGameType("rapid")print(len(profile.games))#720n=0forgameinprofile.games:#Note: this is still filtered to rapidif("resignation"ingame.termination):n+=1print(n)#Note: this will print the number of the player's rapid games that ended in resignation#334italian_games=profile.find_games_with_FEN_and_Color("r1bqkbnr/pppp1ppp/2n5/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R",True)#Note: this FEN is the italian game and the target player color is white (because is_white is set to True)print(len(italian_games)/len(profile.white_games))#Note: this will print the percentage of rapid games (where the player is white) that the player has played the italian game#0.013888888888888888InstallingDownload and install the latest release:pipinstallchess-analyticaDocumentationExamplesChessDotCom ClassBoard ClassFeaturesScrape all game info from a given player’s profileSimulate games and analyze themFilter games by time controlLicenseChess-Analytica is licensed under the MIT License.
Check outLICENSE.txtfor the full text.
Package: chessAnalyzer
pythonChessAnalyzerAnalyses games and positions. Possible to have a Game Report similar to the one from chess.com, including graphs.InstallationUse the package managerpipto install pythonChessAnalyzer.pipinstallchessAnalyzerUsageimportos,chessAnalyzer,chessAnalyzer.main# Always use a string for file paths!ca=chessAnalyzer.main.AnnotatePosition(0.5,os.getcwd(),<enginefilepath(string)>)ca.graph(pgn_loc,end_loc)# creates a graphannotated_pgn=ca.annotate_game(pgn_loc)# annotates gamewhite_lost_positions:list,black_lost_positions:list,annotatedgame:list=ca.game_report(pgn_loc,annotate=True)# gets you a game report(saves graph elsewhere)# and more!ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: chess_bead
Chess Bead GameDescriptionPackage for the both chess and Chinese poetry game. The rules of the game involve chess moves from games in pgn format. The board for the game is a Chinese poem of the Tang era, in which the line is equal to 7 characters (the last, 8th vertical is most often punctuation marks). When a piece makes a move, the characters on the board change places. The character on which the piece was is moved to the place of the character to which the move was made.You can get the result texts and visualize it with the package.You can use custom game in PGN format.Inspired by Das Glasperlenspiel by Hermann Hesse.Quick startimportchess_beadascbg=cb.Game()# use random chess game from the example PGN# file included in the packageverses=g.start_game()# get all the permutations in the poemv=cb.Viz(verses,g.author,g.title)# prepare visualizationv.gif()# make the GIF animation with the name#'game.gif' in the working directorydelv# clean up the tmp dirInstallationThe tool could be installed with pippip3 install chess_beadExamples and DocsYou can explore thebrief examplesthat could give you a clue. For the deep sinking read thedocumentation.External resourcesThe poems are taken from the collectionselected from this repository.The package uses cwTeXFangSong font licensed with SIL Open Font License (Version 1.1),see here.Compiled TTFs.
Package: chess-board
chess-boardWhat is chess-board?chess-board is a Python chessboard package with a flexible "just a board" API for graphically representing game positions.What chess-board isnotA chess engineA legal move validatorA PGN parserWhile chess-board is designed to work well with any of these, the idea behind chess-board is that the logic that controls the board should be independent of those other problems.Entry Pointsfromchessboardimportdisplayvalid_fen='rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2'# Initializationgame_board=display.start()# Position change/updatedisplay.update(valid_fen,game_board)# Checking GUI window for QUIT event. (Esc or GUI CANCEL)display.check_for_quit()# Close windowdisplay.terminate()Usagetest.py-examplefromchessboardimportdisplayvalid_fen='rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2'game_board=display.start()whileTrue:display.check_for_quit()display.update(valid_fen,game_board)# board flip interfaceifnotgame_board.flipped:display.flip(game_board)InstallationDownload and install the latest release:# install into virtualenvsourceenv/bin/activate
pipinstallchess-board

or# install with pipenvpipenvinstallchess-board

or# install system-widepipinstallchess-boardAlternatively, you couldgit clonethis repo and add the directory to your package.gitclonehttps://github.com/ahira-justice/chess-board.gitDependenciespygame==2.1.2chess-boardinstallation automatically installs latestpygameversion.LicenseGNU GENERAL PUBLIC LICENSE
Package: chessbot
Community Chess BotA moderator bot forCommunity Chess, a collaborative chess game on Reddit.ContributingCreate a virtual environment to work inpyenvexecpython-mvenv.venvActivate the virtual environment each time you open the projectsource.venv/bin/activateInstall dependenciespyenvexecpipinstall-rrequirements/dev.txt`Set upReddit API authenticationTo perform type checking, usepyenvexecmypysrc/__init__.pyTo run the tests, usepyenvexecpython-munittestdiscover-ssrcRun the bot--helpshows options--timeoutsets how frequently the bot should look for moves to play--logsets the log level# Enable verbose logging and# check for moves on the current post every five secondspyenvexecpythonsrc/main.py--logINFO--timeout5AuthenticationThis bot uses Praw'sCode Flowfor authentication.Create an application in your Redditapplication preferences. Note yourclient_secret, shown when your pressedit, and yourclient_id, listed belowpersonal use script.Set up yourpraw.iniin the project root as follows:[DEFAULT]redirect_uri=http://localhost:8080client_id=MY_CLIENT_IDclient_secret=MY_CLIENT_SECRETuser_agent=script:com.MY_NAME.communitychess:v0.1.0 (by /u/MY_USERNAME)Usepython src/get_refresh_token.pyto generate a refresh token.Add this line to yourpraw.ini:refresh_token=MY_REFRESH_TOKEN
Package: chessbots
ChessbotsIt is simple chess API for bots, which is based onchesslibrary. It provides small functionality, although it is enough
to build your own bot from scratch.Here is an example:>>>importchessbots>>>importchessbots.bot>>>importchessbots.engine>>>chessbots.bot.BaseBot()# The class which contans basic functions for your bot>>>chessbots.bot.ExampleBot()# Built-in bot based on minimax algorithm>>>chessbots.engine.LaunchGame(bot1,bot2)# Function which allows bots to play games against each other
Package: chess-cli-bshio
# Chess[![Build Status](https://travis-ci.com/shimanekb/chess.svg?branch=master)](https://travis-ci.com/shimanekb/chess)
[![codecov](https://codecov.io/gh/shimanekb/chess/branch/master/graph/badge.svg)](https://codecov.io/gh/shimanekb/chess)Chess program in python.
Package: chesscom
Chess.com Python APIUnofficial Chess.com Python API and toolkit. (Work In Progress)This Python API is a wrapper to thePubAPI(a read-only REST API that responds with JSON-LD data).InstallInstall from PyPi:python3 -m pip install chesscomInstall locallygit clone git@github.com:jeffreywardman/chesscom.git
cd chesscom
python3 -m pip install -e .To DoPlot by piece typePlot piece coveragePlot attacked piecesCreate game GIFsDocumentationAutomated versioning and unit tests (within docker container)Final CommentFeel free to add me (jeffreywardman) on chess.com so we can play sometime!