example-package-prajesh 0.1.0
A simple example package for demonstrating Python packaging
License: MIT
Requires Python: >=3.7
Keywords: example, calculator, packaging

# Example Package

A simple Python package demonstrating modern packaging practices with `pyproject.toml` (PEP 621).

## Features

- 🧮 **Calculator Module**: Basic arithmetic operations (add, subtract, multiply, divide)
- 🛠️ **Utility Functions**: Helper functions for formatting results
- 🖥️ **CLI Tool**: Command-line interface for quick calculations
- ✅ **Well Tested**: 100% test coverage with pytest
- 📦 **Modern Packaging**: Uses pyproject.toml standard

## Installation

### From Source

```bash
# Clone the repository
git clone https://github.com/yourusername/example-package.git
cd example-package

# Install in development mode
pip install -e .

# Or install with development dependencies
pip install -e ".[dev]"
```

### From PyPI (once published)

```bash
pip install example-package
```

## Usage

### As a Library

```python
from example_package.core import Calculator
from example_package.utils import format_result

# Create calculator instance
calc = Calculator()

# Perform calculations
result = calc.add(5, 3)
print(result)  # Output: 8

result = calc.multiply(4, 7)
print(format_result(result))  # Output: Result: 28
```

### Command-Line Interface

```bash
# Addition
example-calc add 10 5
# Output: Result: 15

# Subtraction
example-calc subtract 20 8
# Output: Result: 12

# Multiplication
example-calc multiply 6 7
# Output: Result: 42

# Division
example-calc divide 15 3
# Output: Result: 5.0
```

## Development

### Running Tests

```bash
# Run all tests
pytest

# Run with coverage report
pytest --cov=example_package --cov-report=term-missing

# Run specific test file
pytest tests/test_core.py -v
```

### Code Quality

```bash
# Format code with black
black src/ tests/

# Lint code with flake8
flake8 src/ tests/

# Type checking with mypy
mypy src/
```

### Building the Package

```bash
# Install build tools
pip install build

# Build distribution packages
python -m build

# This creates:
# - dist/example_package-0.1.0-py3-none-any.whl
# - dist/example_package-0.1.0.tar.gz
```

### Publishing to PyPI

```bash
# Install twine
pip install twine

# Upload to PyPI (requires account)
python -m twine upload dist/*

# Or upload to TestPyPI first
python -m twine upload --repository testpypi dist/*
```

## Project Structure

```
python-package/
├── src/
│   └── example_package/
│       ├── __init__.py          # Package initialization
│       ├── core.py              # Calculator class
│       ├── utils.py             # Utility functions
│       └── cli.py               # CLI entry point
├── tests/
│   ├── __init__.py
│   └── test_core.py             # Test suite
├── docs/
│   └── usage.md                 # Extended documentation
├── pyproject.toml               # Package configuration
├── README.md                    # This file
├── LICENSE                      # MIT License
└── .gitignore                   # Git ignore rules
```

## Requirements

- Python 3.7 or higher

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Links

- **Homepage**: https://github.com/yourusername/example-package
- **Documentation**: https://github.com/yourusername/example-package/blob/main/README.md
- **Bug Reports**: https://github.com/yourusername/example-package/issues

## Author

Your Name (your.email@example.com)