Metadata-Version: 2.4
Name: decentralearn
Version: 0.1.0
Summary: A decentralized federated learning framework with privacy guarantees
Home-page: https://github.com/decentralearn/decentralearn
Author: DecentraLearn Team
Author-email: team@decentralearn.ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: opacus>=1.1.0
Requires-Dist: phe>=1.5.0
Requires-Dist: web3>=6.0.0
Requires-Dist: eth-tester>=0.9.0
Requires-Dist: eth-utils>=2.1.0
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=4.5.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# DecentraLearn

[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen)](docs/index.md)
[![Tests](https://github.com/yourusername/decentralearn/actions/workflows/tests.yml/badge.svg)](https://github.com/yourusername/decentralearn/actions/workflows/tests.yml)

A decentralized federated learning framework with strong privacy guarantees, built on blockchain technology.

## 🚀 Features

- **Federated Learning**
  - Decentralized model training
  - Secure model aggregation
  - Incentive mechanisms
  - Smart contract-based coordination

- **Privacy Mechanisms**
  - Differential Privacy
  - Homomorphic Encryption
  - Zero-Knowledge Proofs
  - Secure Aggregation

- **Blockchain Integration**
  - Smart contract-based verification
  - Transparent model tracking
  - Decentralized coordination
  - Incentive distribution

- **Advanced Security**
  - End-to-end encryption
  - Model integrity verification
  - Access control
  - Audit logging

## 📦 Installation

### Prerequisites

- Python 3.8 or higher
- Ethereum node (e.g., Ganache for development)
- PyTorch 1.7 or higher

### Installation Steps

1. Clone the repository:
   ```bash
   git clone https://github.com/yourusername/decentralearn.git
   cd decentralearn
   ```

2. Create and activate a virtual environment:
   ```bash
   python -m venv .venv
   source .venv/bin/activate  # On Windows: .venv\Scripts\activate
   ```

3. Install dependencies:
   ```bash
   pip install -e .
   ```

## 🏁 Quick Start

1. Initialize blockchain connection:
   ```python
   from decentralearn.blockchain.client import BlockchainClient
   from decentralearn.config.blockchain_config import BlockchainConfig

   config = BlockchainConfig(
       rpc_url="http://localhost:8545",
       chain_id=1337
   )
   client = BlockchainClient(config)
   ```

2. Create and train a model:
   ```python
   from decentralearn.models.base import BaseModel
   from decentralearn.privacy import DifferentialPrivacy

   model = BaseModel()
   dp = DifferentialPrivacy(epsilon=0.1)
   # Train model with privacy
   ```

3. Upload to blockchain:
   ```python
   client.upload_model(model)
   ```

## 📚 Documentation

Comprehensive documentation is available in the `docs/` directory:

- [Architecture Overview](docs/architecture/overview.md)
- [API Reference](docs/api/README.md)
- [Tutorials](docs/tutorials/README.md)
- [Examples](docs/examples/README.md)
- [Development Guide](docs/development/README.md)

## 🧪 Testing

Run the test suite:

```bash
pytest tests/
```

For detailed test output:
```bash
pytest -v tests/
```

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](docs/development/contributing.md) for details.

1. Fork the repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request

## 📝 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 📧 Support

For questions and support:

1. Check the [FAQ](docs/faq.md)
2. Open an issue on GitHub
3. Contact the maintainers

## 🙏 Acknowledgments

- PyTorch team for the deep learning framework
- Ethereum community for blockchain infrastructure
- Privacy research community for privacy-preserving techniques

## 📄 Citation

If you use DecentraLearn in your research, please cite:

```bibtex
@software{decentralearn2024,
  author = {Jihad GARTI},
  title = {DecentraLearn: A Decentralized Federated Learning Framework},
  year = {2024},
  publisher = {ackerman23},
  url = {https://github.com/ackerman23/decentralearn}
}
```
