semvec/pypi-packages huggingface dataset:
lcs2 2.0.0
Compute the longest or optimal weighted, most contiguous common subsequence and diff for a pair of sequences
Requires Python: >=3.12

# lcs2
`lcs2` is a Python package that helps find the longest common—or optimal weighted—subsequence of a pair of sequences and compute their diff. Among all optimal subsequences, it returns the one with the fewest runs (i.e., contiguous segments) across the two sequences.

## Installation
```
pip install lcs2
```

## Reference
The package provides the following functions, where `weight[A, B] = Callable[[A, B], int | float]`.

If the `weight` function is provided, it should return positive values if and only if the two elements can be matched. If the `weight` function is omitted, the elements are considered equal if they are identical, and the classical LCS sequence is returned.

| Function      | Signature                                                                  | Result                                                      |
|:--------------|:---------------------------------------------------------------------------|:------------------------------------------------------------|
| `lcs`         | `Iterable[A], Iterable[B], weight[A, B]?, take_b? -> list[A] \| list[B]`   | Longest (or optimal weighted) common subsequence (LCS/OWCS) |
| `lcs_indices` | `Iterable[A], Iterable[B], weight[A, B]? -> list[tuple[int, int]]`         | Indices of the LCS/OWCS                                     |
| `lcs_length`  | `Iterable[A], Iterable[B] -> int`                                          | Length of the LCS                                           |
| `lcs_weight`  | `Iterable[A], Iterable[B], weight[A, B] -> int \| float`                   | Weight of the OWCS                                          |
| `diff`        | `Iterable[A], Iterable[B], weight[A, B]? -> list[tuple[list[A], list[B]]]` | Differing segments of the sequences based on the LCS/OWCS   |
| `diff_ranges` | `Iterable[A], Iterable[B], weight[A, B]? -> list[tuple[range, range]]`     | Ranges of indices of the differing segments                 |

## Sample Usage
```python
from lcs2 import diff, diff_ranges, lcs, lcs_indices, lcs_length, lcs_weight

a = 'Hello, world!'
b = 'Foobar'

print(lcs(a, b))  # ['o', 'o', 'r']
print(lcs_indices(a, b))  # [(4, 1), (8, 2), (9, 5)]
print(lcs_length(a, b))  # 3

print(diff(a, b))  # [(['H', 'e', 'l', 'l'], ['F']),
                   # ([',', ' ', 'w'], []),
                   # ([], ['b', 'a']),
                   # (['l', 'd', '!'], [])]
print(diff_ranges(a, b))  # [(range(0, 4), range(0, 1)),
                          # (range(5, 8), range(2, 2)),
                          # (range(9, 9), range(3, 5)),
                          # (range(10, 13), range(6, 6))]

print(lcs(
    'xo',
    'xXOo',
    weight=lambda ca, cb: 1 if ca.lower() == cb.lower() else 0,
    take_b=True,
))  # ['X', 'O']

print(lcs_weight(
    'xxxoo',
    'ooxxx',
    weight=lambda ca, cb: {'x': 1, 'o': 2}[ca] if ca == cb else 0,
))  # 4
```
playwright-server-custom 0.1.4
Playwright MCP server
Requires Python: >=3.11

# playwright-server MCP server

Playwright MCP server

## Components

### Resources

The server implements a simple note storage system with:
- Custom note:// URI scheme for accessing individual notes
- Each note resource has a name, description and text/plain mimetype

### Prompts

The server provides a single prompt:
- summarize-notes: Creates summaries of all stored notes
  - Optional "style" argument to control detail level (brief/detailed)
  - Generates prompt combining all current notes with style preference

### Tools

The server implements one tool:
- add-note: Adds a new note to the server
  - Takes "name" and "content" as required string arguments
  - Updates server state and notifies clients of resource changes

## Configuration

[TODO: Add configuration details specific to your implementation]

## Quickstart

### Install

#### Claude Desktop

On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

<details>
  <summary>Development/Unpublished Servers Configuration</summary>
  ```
  "mcpServers": {
    "playwright-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/home/jyoti/web-testing-poc/backend/server/playwright-server",
        "run",
        "playwright-server"
      ]
    }
  }
  ```
</details>

<details>
  <summary>Published Servers Configuration</summary>
  ```
  "mcpServers": {
    "playwright-server": {
      "command": "uvx",
      "args": [
        "playwright-server"
      ]
    }
  }
  ```
</details>

## Development

### Building and Publishing

To prepare the package for distribution:

1. Sync dependencies and update lockfile:
```bash
uv sync
```

2. Build package distributions:
```bash
uv build
```

This will create source and wheel distributions in the `dist/` directory.

3. Publish to PyPI:
```bash
uv publish
```

Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token: `--token` or `UV_PUBLISH_TOKEN`
- Or username/password: `--username`/`UV_PUBLISH_USERNAME` and `--password`/`UV_PUBLISH_PASSWORD`

### Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging
experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).


You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:

```bash
npx @modelcontextprotocol/inspector uv --directory /home/jyoti/web-testing-poc/playwright-server run playwright-server
```


Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.