semvec/pypi-packages huggingface dataset:
pal_api 0.1.1
API Wrapper for Palworld Dedicated Server
License: MIT
Requires Python: >=3.10

# pal_api
API Wrapper for Palworld Dedicated Server  
### Usage
_Install_  
```sh
pip install pal_api
### Option ###
pip install ujson
```
_Sync_
```python
from pal_api import PalApiClient
client = PalApiClient(password="password")
print(client.get_server_info())

# with Context Manager
with PalApiClient(password="password") as client:
    print(client.get_server_info())
```
_Async_
```python
import asyncio
from pal_api import AsyncPalApiClient

async def main():
    client = AsyncPalApiClient(password="password")
    print(await client.get_server_info())
    await client.close()

asyncio.run(main())

# with Context Manager
async def main():
    async with AsyncPalApiClient(password="password") as client:
        print(await client.get_server_info())

asyncio.run(main())
```
_Options and Default Values for the Class_
|name|class|default|
|---|---|---|
|host|str|"localhost"|
|port|int|8212|
|username|str|"admin"|
|password|str||
|timeout|int|5|
|session(async only)|aiohttp.ClientSession|None|

_method_
```python
get_server_info() -> ServerInfo
get_player_list() -> PlayerList
get_server_settings() -> dict
get_server_metrics() -> ServerMetrics
announce_message(message: str) -> None
kick_player(userid: str, message: str = "") -> None
ban_player(userid: str, message: str = "") -> None
unban_player(userid: str) -> None
save_world() -> None
shutdown_server(waittime: int = 10, message: str | None = None, force: bool = False) -> None
```

### やってること・その他
- playerIdが負の数が返ってくることがある -> とりあえず正の数に直してます
- ログイン中にSteamの名前が返ってくる -> playerIdがNoneのものは除外しています
- BanするとbanlistにはIDが乗るが、効いてなさそう(コミュニティサーバー未確認)
- また、間違ったIDを送ってもとりあえずリストには乗る
- Banするときにメッセージを送れるが、どこに表示されているのか不明

License MIT ©[Charahiro-tan](https://twitter.com/__Charahiro)
constable 0.3.1
One decorator for lazy debugging. Inserts print statements directly into your AST.
License: MIT
Keywords: debugger, decorator, tracker, state tracker, variable state, timer

constable
--------------

constable allows you to monitor the state of specified variables at each assignment operation, providing a step-by-step view of variable changes!

View the `Github repository <https://github.com/saurabh0719/constable>`__ and the `official docs <https://github.com/saurabh0719/constable#README>`__.


How does it work?
~~~~~~~~~~~~~~~~~~

The `constable.trace` decorator uses Python's Abstract Syntax Tree (AST) in much the same way we add `print`(s) to debug states. During runtime, it prepares and inserts `print` statements into the function's AST after every assignment operation (`ast.Assign`, `ast.AugAssign` and `ast.AnnAssign`), and then executes the modified code in a separate namespace with `exec`.


.. code:: sh

    $ pip install constable

Tested for python 3.8 and above.


Usage :
~~~~~~~~~~~~~


Tracking variables in a function

.. code:: python

    import constable

    @constable.trace('a', 'b')
    def example(a, b):
        a = a + b
        c = a
        a = "Experimenting with the AST"
        b = c + b
        a = c + b
        return a

    example(5, 6)


Output :

::

    constable: example: line 5
        a = a + b
        a = 11
        type(a) = <class 'int'>

    constable: example: line 7
        a = "Experimenting with the AST"
        a = Experimenting with the AST
        type(a) = <class 'str'>

    constable: example: line 8
        b = c + b
        b = 17
        type(b) = <class 'int'>

    constable: example: line 9
        a = c + b
        a = 28
        type(a) = <class 'int'>

    constable: example: line 3 to 10
        args: (5, 6)
        kwargs: {}
        returned: 28
        execution time: 0.00018480 seconds


Monitor functions

.. code:: python

    import constable

    @constable.trace()
    def add(a, b):
        return a + b

    add(5, 6)

Output :

::

    constable: add: line 3 to 5
        args: (5, 6)
        kwargs: {}
        returned: 11
        execution time: 0.00004312 seconds