Spaces:
Sleeping
Sleeping
Download client.py from printf-sourav/CSV_DC_ENV: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/printf-sourav/CSV_DC_ENV/resolve/main/client.py
- Command line
-
hf download hf://spaces/printf-sourav/CSV_DC_ENV/client.py
-
curl -L -o client.py https://huggingface.co/spaces/printf-sourav/CSV_DC_ENV/resolve/main/client.py
1.16 kB
| """ | |
| CSV Cleaner Environment Client. | |
| Provides the client for connecting to a CSV Cleaner Environment server. | |
| CsvCleanerEnv extends MCPToolClient to provide tool-calling style interactions. | |
| Example: | |
| >>> with CsvCleanerEnv(base_url="http://localhost:8000") as env: | |
| ... env.reset() | |
| ... tools = env.list_tools() | |
| ... result = env.call_tool("cast_column", column="age", dtype="int") | |
| ... print(result) | |
| Example with Docker: | |
| >>> env = CsvCleanerEnv.from_docker_image("csv-cleaner-env:latest") | |
| >>> try: | |
| ... env.reset() | |
| ... tools = env.list_tools() | |
| ... result = env.call_tool("fill_missing", column="salary", strategy="mean") | |
| ... finally: | |
| ... env.close() | |
| """ | |
| from openenv.core.mcp_client import MCPToolClient | |
| class CsvCleanerEnv(MCPToolClient): | |
| """ | |
| Client for the CSV Cleaner Environment. | |
| Inherits all functionality from MCPToolClient: | |
| - list_tools(): Discover available cleaning tools | |
| - call_tool(name, **kwargs): Call a cleaning tool by name | |
| - reset(**kwargs): Reset with a new messy dataset | |
| - step(action): Execute a cleaning action | |
| """ | |
| pass | |