Metadata-Version: 2.4
Name: dcprac-algorithms
Version: 0.1.1
Summary: Python implementations of classic distributed computing algorithms.
Author: dcprac
License: MIT
Project-URL: Homepage, https://example.com/dcprac-algorithms
Project-URL: Repository, https://example.com/dcprac-algorithms
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# dcprac-algorithms

Python package version of your Java implementations for:

- Banker's Algorithm
- Berkeley Time Synchronization (kept as `berkely` for compatibility with your naming)
- Bully Election Algorithm
- Distributed Global Average (ring neighbors)
- Raymond Mutual Exclusion (simplified simulation)
- Ricart-Agrawala Mutual Exclusion

## Install locally

```bash
pip install -e .
```

## Quick usage

```python
from dc_algorithms import (
    is_safe_state,
    synchronize_times,
    run_bully_election,
    run_distributed_global_average,
    RaymondMutex,
    evaluate_ricart_request,
)

safe, seq = is_safe_state(
    allocation=[[0, 1], [1, 0]],
    max_demand=[[1, 1], [1, 1]],
    available=[1, 0],
)
print(safe, seq)
```

## Build package

```bash
python -m pip install --upgrade build twine
python -m build
```

This creates artifacts in `dist/`.

## Publish to PyPI

```bash
python -m twine upload dist/*
```

Before publishing, update at least:

- `version` in `pyproject.toml`
- `project.urls` in `pyproject.toml`
- author metadata if needed
