semvec/pypi-packages huggingface dataset:
ds-store 1.3.2
Manipulate Finder .DS_Store files from Python
Requires Python: >=3.10
Keywords: DS_Store

========
ds_store
========

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/ds_store.svg
   :target: https://pypi.python.org/pypi/ds_store
   :alt: Python Versions

.. |version| image:: https://img.shields.io/pypi/v/ds_store.svg
   :target: https://pypi.python.org/pypi/ds_store
   :alt: PyPI Version

.. |maturity| image:: https://img.shields.io/pypi/status/ds_store.svg
   :target: https://pypi.python.org/pypi/ds_store
   :alt: Maturity

.. |license| image:: https://img.shields.io/pypi/l/ds_store.svg
   :target: https://github.com/dmgbuild/ds_store/blob/main/LICENSE
   :alt: MIT License

.. |ci| image:: https://github.com/dmgbuild/ds_store/workflows/CI/badge.svg?branch=main
   :target: https://github.com/dmgbuild/ds_store/actions
   :alt: Build Status

|pyversions| |version| |maturity| |license| |ci|

What is this?
-------------

``ds_store`` lets you examine and modify ``.DS_Store`` files from Python
code; since it is written in pure Python, it is portable and will run on any
platform, not just Mac OS X.

Credit is due to Wim Lewis, Mark Mentovai and Yvan Barthélemy for
reverse-engineering the .DS_Store file format. See
`Wim Lewis’ excellent documentation on CPAN`__ for more information.

__ http://search.cpan.org/~wiml/Mac-Finder-DSStore/DSStoreFormat.pod
streamstraight-server 0.2.10
Python server SDK for streaming data into Streamstraight.
Requires Python: >=3.10
Keywords: streaming, socket.io, websockets, sdk, llm, streamstraight

# Streamstraight Python SDK

`streamstraight-server` mirrors the `@streamstraight/server` Node SDK for producers who prefer Python. It connects to Streamstraight over Socket.IO, manages chunk acknowledgements, and exposes helpers for minting client JWTs.

## Quickstart

```bash
uv add streamstraight-server
```

## Usage

Streamstraight needs a unique `stream_id` for every stream you produce. Once connected, you can either push chunks manually with the writer API or hand us an async iterator/object that yields JSON‑serializable chunks. The writer reuses the most recent stream configuration, so call `await server.connect({...})` again if you need to swap streams or override the encoder.

### Push chunks with the writer context manager

```python
import asyncio
from collections.abc import AsyncIterator

from streamstraight_server import streamstraight_server


async def generate() -> AsyncIterator[str]:
    yield "first"
    yield "second"


async def main() -> None:
    server = await streamstraight_server(
        {"api_key": "YOUR_STREAMSTRAIGHT_API_KEY"},
        {"stream_id": "your-stream-id"},
    )  # connects and configures the stream

    async with server.stream_writer() as writer:
        async for chunk in generate():
            await writer.send(chunk)  # returns an asyncio.Future you can await later if needed
            # You can optionally mirror the same chunks to your HTTP response here.

asyncio.run(main())
```

### Pipe an async iterator directly

```python
import asyncio
from streamstraight_server import streamstraight_server


async def generate():
    # Replace with your LLM or other async generator
    yield {"content": "first chunk"}
    yield {"content": "second chunk"}


async def main() -> None:
    server = await streamstraight_server(
        {"api_key": "YOUR_STREAMSTRAIGHT_API_KEY"},
        {"stream_id": "your-stream-id"},
    )

    await server.stream(generate())

asyncio.run(main())
```

### Mint a client JWT for your browser client

```python
from streamstraight_server import fetch_client_token

token = await fetch_client_token({"api_key": "YOUR_STREAMSTRAIGHT_API_KEY"})
```

## Logging

The SDK defaults to logging only errors. To see more detailed logs (useful for debugging connection issues), you can adjust the log level:

```python
import logging

# Set to INFO to see connection attempts and stream lifecycle
logging.getLogger("streamstraight_server").setLevel(logging.INFO)

# Set to DEBUG to see all internal operations
logging.getLogger("streamstraight_server").setLevel(logging.DEBUG)

# Disable SDK logging entirely
logging.getLogger("streamstraight_server").setLevel(logging.CRITICAL)
```
gym-info 0.1.1
Information-theoretic metrics for Gymnasium environments
Requires Python: >=3.10

# gym_info

Information-theoretic diagnostics for Gymnasium environments.

`gym_info` helps you inspect **state and action entropies** in RL environments with minimal changes to your existing Gymnasium code. You wrap an environment once, run your usual interaction loop, and then query global or per-episode entropy metrics, tables, and simple reports.

---

## Installation

```bash
pip install gym_info
# or, with uv:
# uv add gym_info
```

Requirements:
- Python: $\geq$ 3.10
- Gymnasium: $\geq$ 1.2.2

## Quick Start

```bash
import gymnasium as gym
import gym_info as gi

# 1. Create and wrap the environment
env = gym.make("CartPole-v1")
env = gi.attach(env, preset="classic_control", run_id="demo-run")

# 2. Run your usual interaction loop
obs, info = env.reset(seed=0)
for _ in range(200):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        obs, info = env.reset()

# 3. Global entropies for the whole run (in bits)
metrics = gi.entropies(env)
print(metrics.H_S, metrics.H_A, metrics.H_A_given_S)

# 4. High-level summary
summ = gi.summary(env)
gi.print_table(summ)         # text table
gi.plot_entropies(summ)      # matplotlib figure

```

## Per-episode Analysis

You can inspect entropies for each completed episode separately.

```bash
from gym_info import entropies_per_episode, episode_entropy_series, episode_entropy_dataframe

episode_metrics = entropies_per_episode(env)
for i, m in enumerate(episode_metrics):
    print(f"Episode {i}: H(S)={m.H_S:.3f}, H(A)={m.H_A:.3f}, H(A|S)={m.H_A_given_S:.3f}")

series = episode_entropy_series(env)
df = episode_entropy_dataframe(env)
```

## Discretization

gym_info works by discretizing continuous observations and actions into bins and then computing histogram-based entropies.

- A preset encapsulates reasonable default binning strategies for a family of environments.

- Currently, the main preset is:

  - preset="classic_control": designed for standard classic control environments such as CartPole-v1 and MountainCar-v0.

You can override discretization globally by passing obs_bins and action_bins to attach:

```bash
env = gi.attach(
    env,
    preset="classic_control",
    run_id="demo-run",
    obs_bins=20,    # here
    action_bins=5,  # here
)
```