Skip to main content
Glama

chesscom-mxcp

player_tools_simple.cpython-311.pyc4.85 kB
� g�[h" ��L�dZddlmZmZmZddlZddlZddlZddlZddl Z e j � dej � ej � e ������ddlmZmZdedeeeffd�Zdedeeeffd�Zdedeeeffd �ZdS) z6 Simplified Chess.com player tools without analytics. �)�Dict�Any�ListN)� API_CONFIG� CACHE_TTL�username�returnc��K�tjdd��}|�d|��} tj��4�d{V��}|�|���d{V��}|���|���cddd���d{V��S#1�d{V��swxYwYdS#t $r}ddt|����icYd}~Sd}~wwxYw)z� Get a player's profile information from Chess.com. Args: username: The Chess.com username Returns: Player profile data including join date, status, followers, etc. �base_url�https://api.chess.com/pub�/player/N�errorz Failed to fetch player profile: �r�get�httpx� AsyncClient�raise_for_status�json� Exception�str�rr �endpoint�client�response�es �3/home/yori/chess-mxcp/python/player_tools_simple.py�get_player_profilers������~�j�*E�F�F�H��.�.�H�.�.�H�F��$�&�&� #� #� #� #� #� #� #�&�#�Z�Z��1�1�1�1�1�1�1�1�H� � %� %� '� '� '��=�=�?�?� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #���� #� #� #� #� #� #�� �F�F�F��D�C��F�F�D�D�E�E�E�E�E�E�E�����F���sA�B"�AB�<B"� B�B"�B�B"�" C �,C�?C �C c��K�tjdd��}|�d|�d�} tj��4�d{V��}|�|���d{V��}|���|���cddd���d{V��S#1�d{V��swxYwYdS#t $r}ddt|����icYd}~Sd}~wwxYw)z� Get a player's chess statistics from Chess.com. Args: username: The Chess.com username Returns: Player statistics for different game types (chess_blitz, chess_rapid, etc.) r r r z/statsNrzFailed to fetch player stats: rrs r�get_player_statsr&s������~�j�*E�F�F�H��4�4�H�4�4�4�H�D��$�&�&� #� #� #� #� #� #� #�&�#�Z�Z��1�1�1�1�1�1�1�1�H� � %� %� '� '� '��=�=�?�?� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #���� #� #� #� #� #� #�� �D�D�D��B�#�a�&�&�B�B�C�C�C�C�C�C�C�����D���sA�B#�AB�=B#� B�B#�B�B#�# C �-C�C �C c��K�tjdd��}|�d|�d�} tj��4�d{V��}|�|���d{V��}|���|���cddd���d{V��S#1�d{V��swxYwYdS#t $r}dt|��d�cYd}~Sd}~wwxYw)z� Check if a player is currently online on Chess.com. Args: username: The Chess.com username Returns: Dictionary with 'online' boolean value r r r z /is-onlineNF)�onlinerrrs r�is_player_onliner"<s������~�j�*E�F�F�H��8�8�H�8�8�8�H�2��$�&�&� #� #� #� #� #� #� #�&�#�Z�Z��1�1�1�1�1�1�1�1�H� � %� %� '� '� '��=�=�?�?� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #� #���� #� #� #� #� #� #�� �2�2�2��#�a�&�&�1�1�1�1�1�1�1�1�����2���sA�B#�AB�=B#� B�B#�B�B#�# C �-C�>C �C )�__doc__�typingrrrr�asyncior�os�sys�path�insert�dirname�__file__� chess_configrrrrr�boolr"��r�<module>r0s<����#�"�"�"�"�"�"�"�"�"� � � � ����� � � � � � � � � � � � ������2�7�?�?�2�7�?�?�8�#<�#<�=�=�>�>�>�.�.�.�.�.�.�.�.�F�s�F�t�C��H�~�F�F�F�F�,D�S�D�T�#�s�(�^�D�D�D�D�,2�S�2�T�#�t�)�_�2�2�2�2�2�2r/

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/datYori/chesscom-mxcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server