semvec/pypi-packages huggingface dataset:
dkrresource 1.2
This library standardizes logs and exceptions, ensuring consistent error handling and tracking.
Requires Python: >=3.7

# **Dkr Resource**

> This Python library is designed to monitor and log system resource usage (CPU and RAM) during the execution of a routine. It collects data periodically and stores it in a database, allowing users to track the resource consumption of their applications.

## **Installation**

```plaintext
pip install dkrresource
```

## **Configuration**

To use ResourceManager, configure the following parameters:

- **routine_name**: Name of the routine being monitored.
- **start_date**: Start time of the routine.
- **routine_path**: Path where the routine is running.
- **db_str**: Database connection string.
- **t_channel**: Teams channel for error reporting.
- **t_url**: Teams webhook URL for reporting errors.

## **Usage**

```python
from datetime import datetime as dt
from resourcemanager import ResourceManager


routine_name = "DataPipeline"
start_date = dt.now()
routine_path = "/path/to/routine"
db_str = "postgresql://user:password@localhost/dbname"
t_channel = "resource-alerts"
t_url = "https://teams.webhook.url"


# Initialize the ResourceManager
rm = ResourceManager(
    routine_name,
    start_date,
    routine_path,
    db_str,
    t_channel,
    t_url
)

# Start resource monitoring
rm.start_collection()

# Execute some processing...

# Stop collecting and log final data
rm.finish_collection()
```
## **Database Logging**

The library logs the following resource metrics in a database:

- **Maximum CPU usage**
- **Average CPU usage**
- **Maximum RAM usage**
- **Average RAM usage**

## **Error Reporting**

If an issue occurs during execution, **ResourceManager** sends an error notification to a Microsoft Teams channel using the provided webhook.


## **License**

This project is licensed under the MIT License.
mcp-client-for-testing 0.1.8
A minimalistic MCP client for testing MCP Server
Requires Python: >=3.10
Keywords: mcp, client, testing

# MCP Client for Testing

A minimalistic MCP (Model Context Protocol) client for testing tool calls in MCP servers.

## Usage

Install [uv](https://docs.astral.sh/uv/) and test a tool call in an MCP server like this:

```bash
uvx mcp-client-for-testing \
    --config '
    [
        {
            "name": "name of mcp server",
            "command": "uv",
            "args": [
                "--directory", 
                "path/to/root/dir/", 
                "run", 
                "server.py"
            ],
            "env": {}
        }
    ]
    ' \
    --client_log_level "WARNING" \
    --server_log_level "INFO" \
    --tool_call '{"name": "tool-name", "arguments": {}}'
```

To use it in code, install the package:

```bash
uv pip install mcp-client-for-testing 
```

and use it like this:

```python
import asyncio

from mcp_client_for_testing.client import execute_tool

async def main():
    config = [
        {
            "name": "name of mcp server",
            "command": "uv",
            "args": [
                "--directory", 
                "path/to/root/dir/", 
                "run", 
                "server.py"
            ],
            "env": {}
        }
    ]
    tool_call = {"name": "tool-name", "arguments": {}}
    
    await execute_tool(config, tool_call)

if __name__ == "__main__":
    asyncio.run(main())
```

## Example

Use the [echo-mcp-server-for-testing](https://github.com/piebro/echo-mcp-server-for-testing) with `uvx` to test the MCP client.

```bash
uvx mcp-client-for-testing \
    --config '
    [
        {
            "name": "echo-mcp-server-for-testing",
            "command": "uvx",
            "args": [
                "echo-mcp-server-for-testing"
            ],
            "env": {
                "SECRET_KEY": "123456789"
            }
        }
    ]
    ' \
    --client_log_level "WARNING" \
	--server_log_level "INFO" \
    --tool_call '{"name": "echo_tool", "arguments": {"message": "Hello, world!"}}'
```

## Development

### Installation from source

1. Clone the repo `git clone git@github.com:piebro/mcp-client-for-testing.git`.
2. Go into the root dir `cd mcp-client-for-testing`.
3. Install in development mode: `uv pip install -e .`

### Formatting and Linting

The code is formatted and linted with ruff:

```bash
uv run ruff format
uv run ruff check --fix
```

### Building with uv

Build the package using uv:

```bash
uv build
```

### Releasing a New Version

To release a new version of the package to PyPI, create and push a new Git tag:

1. Checkout the main branch and get the current version:
   ```bash
   git checkout main
   git pull origin main
   git describe --tags
   ```

2. Create and push a new Git tag:
   ```bash
   git tag v0.2.0
   git push origin v0.2.0
   ```

The GitHub Actions workflow will automatically build and publish the package to PyPI when a new tag is pushed.
The python package version number will be derived directly from the Git tag.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
stream-inflate 0.0.42
Uncompress DEFLATE streams in pure Python (albeit compiled with Cython)
Requires Python: >=3.7.7

# stream-inflate [![PyPI package](https://img.shields.io/pypi/v/stream-inflate?label=PyPI%20package)](https://pypi.org/project/stream-inflate/) [![Test suite](https://img.shields.io/github/actions/workflow/status/michalc/stream-inflate/test.yml?label=Test%20suite)](https://github.com/michalc/stream-inflate/actions/workflows/test.yml) [![Code coverage](https://img.shields.io/codecov/c/github/michalc/stream-inflate?label=Code%20coverage)](https://app.codecov.io/gh/michalc/stream-inflate)

Uncompress Deflate and Deflate64 streams in pure Python (albeit compiled with Cython).


## Installation

```bash
pip install stream-inflate
```


## Usage

To uncompress Deflate, use the `stream_inflate` function.

```python
from stream_inflate import stream_inflate
import httpx

def compressed_chunks():
    # Iterable that yields the bytes of a DEFLATE-compressed stream
    with httpx.stream('GET', 'https://www.example.com/my.txt') as r:
        yield from r.iter_raw(chunk_size=65536)

for uncompressed_chunk in stream_inflate()[0](compressed_chunks()):
    print(uncompressed_chunk)
```

To uncompress Deflate64, use the `stream_inflate64` function.

```python
for uncompressed_chunk in stream_inflate64()[0](compressed_chunks()):
    print(uncompressed_chunk)
```

For Deflate streams of unknown length where there may be other data _after_ the compressed part, the following pattern can be used to find how many bytes are not part of the compressed stream.

```python
uncompressed_chunks, is_done, num_bytes_unconsumed = stream_inflate()
it = iter(compressed_chunks())

while not is_done():
    chunk = next(it)
    for uncompressed in uncompressed_chunks((chunk,))
        print(uncompressed)

print(num_bytes_unconsumed())
```

This can be useful in certain ZIP files.