Metadata-Version: 2.4
Name: speedopy
Version: 0.1.0
Summary: Zero-dependency performance measurement decorators for Python
Author-email: AayushtheCoder01 <aayushkumarkumar1234@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/AayushtheCoder01/speedopy
Project-URL: Repository, https://github.com/AayushtheCoder01/speedopy
Project-URL: Issues, https://github.com/AayushtheCoder01/speedopy/issues
Keywords: performance,profiling,benchmark,decorator,timing,memory
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
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: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Benchmark
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# speedopy

Zero-dependency performance measurement decorators for Python.

Just import a decorator, slap it on your function, and instantly see metrics printed to the console. No config, no setup, no external packages.

## Install

```bash
pip install speedopy
```

## Decorators

| Decorator | What It Measures |
|---|---|
| `cpu_time` | CPU processing time (excludes I/O) |
| `real_time` | Wall-clock time |
| `memory_usage` | Peak memory allocated (auto-formats B/KB/MB) |
| `thread_time` | CPU time for the current thread only |
| `call_count` | Number of times a function has been called |
| `function_profile` | Full cProfile report (top 10 calls) |
| `io_time` | I/O wait time (real - cpu) |
| `gc_stats` | Garbage collections triggered |
| `object_count` | Net new Python objects created |

## Usage

```python
from speedopy import cpu_time, memory_usage, io_time

@cpu_time
@memory_usage
@io_time
def process_data():
    data = [i ** 2 for i in range(1_000_000)]
    return sum(data)

process_data()
```

Output:
```
[io_time] process_data -> real: 0.182345s, cpu: 0.171875s, io_wait: 0.010470s
[memory_usage] process_data -> current: 472 B, peak: 8.06 MB
[cpu_time] process_data -> 0.183291s
```

## Stack Multiple Decorators

```python
from speedopy import cpu_time, memory_usage, call_count

@call_count
@cpu_time
@memory_usage
def my_func():
    return sum(range(500_000))

my_func()  # [call_count] my_func -> called 1 time(s)
my_func()  # [call_count] my_func -> called 2 time(s)
```

## Requirements

- Python 3.8+
- No external dependencies

## License

MIT
