Metadata-Version: 2.4
Name: taman
Version: 0.1.0
Summary: A system monitoring API with real-time process tracking and resource usage
Home-page: https://github.com/yourusername/taman
Author: Your Name
Author-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/taman
Project-URL: Repository, https://github.com/yourusername/taman
Project-URL: Issues, https://github.com/yourusername/taman/issues
Keywords: system,monitoring,fastapi,process,resource
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Monitoring
Classifier: Framework :: FastAPI
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.100.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: uvicorn>=0.20.0
Requires-Dist: wmi>=1.5.1; sys_platform == "win32"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Taman - System Monitoring API

Taman is a FastAPI-based system monitoring tool that provides real-time process tracking and resource usage information through RESTful endpoints and Server-Sent Events (SSE).

## Features

- **Real-time system monitoring**: CPU usage, memory consumption, and process information
- **Process management**: Kill processes by PID
- **Streaming data**: Real-time updates via Server-Sent Events
- **Cross-platform**: Works on Windows, macOS, and Linux
- **REST API**: Clean and simple API endpoints
- **CORS support**: Ready for web frontend integration

## Installation

Install from PyPI:

```bash
pip install taman
```

Or install from source:

```bash
git clone https://github.com/yourusername/taman
cd taman
pip install -e .
```

## Quick Start

### Running the API server

```bash
# Start the server
taman

# Or run directly with Python
python -m taman.main
```

The API will be available at `http://localhost:8000`

### API Endpoints

- `GET /process` - Get current processes list
- `GET /process/stream` - Stream real-time system data (SSE)
- `GET /kill/{pid}` - Terminate a process by PID

### Example Usage

```python
import requests

# Get current processes
response = requests.get("http://localhost:8000/process")
processes = response.json()

# Kill a process
response = requests.get("http://localhost:8000/kill/1234")
```

### Streaming Data Example

```javascript
// JavaScript example for consuming SSE stream
const eventSource = new EventSource('http://localhost:8000/process/stream');

eventSource.onmessage = function(event) {
    const data = JSON.parse(event.data);
    console.log('System Stats:', data.system_stats);
    console.log('Processes:', data.processes);
};
```

## Development

### Setup Development Environment

```bash
# Clone the repository
git clone https://github.com/yourusername/taman
cd taman

# Install with development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black taman/

# Lint code
flake8 taman/
```

### Running in Development Mode

```bash
# Run with auto-reload
uvicorn taman.main:app --reload --host 0.0.0.0 --port 8000
```

## Data Format

### System Stats Response

```json
{
  "system_stats": {
    "cpu_usage": 15.2,
    "cores_usage": [12.1, 18.3, 14.7, 16.8],
    "memory_usage": {
      "total_gb": 16.0,
      "used_gb": 8.5,
      "percent": 53.1
    }
  },
  "processes": [
    {
      "name": "python.exe",
      "pid": 1234,
      "runtime_seconds": 3600.5,
      "ram_bytes": 52428800,
      "threads": 8
    }
  ]
}
```

## Requirements

- Python 3.8+
- FastAPI
- psutil
- uvicorn
- wmi (Windows only)

## License

MIT License - see LICENSE file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Support

If you encounter any issues, please file a bug report on the [GitHub Issues](https://github.com/yourusername/taman/issues) page.
