Metadata-Version: 2.1
Name: otime
Version: 0.1.1
Summary: A package for analyzing time complexity of functions
Home-page: https://github.com/MeatyAri/otime
Author: Arian Rahmatpour
Author-email: meatyari@proton.me
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20.0
Requires-Dist: matplotlib>=3.3.0

# OTime: Time Complexity Analyzer
A Python package for empirically analyzing the time complexity of functions.

## Installation
```bash
pip install otime
```

## Usage
```python
from otime import analyze_time_complexity

def my_function(data):
    # Your function here
    pass

sizes = [100, 200, 400, 800, 1600]
complexity, r_squared = analyze_time_complexity(
    my_function,
    lambda x: list(range(x)),  # Input generator
    sizes
)
print(f"Time complexity: {complexity}")
print(f"R-squared: {r_squared}")
```

## More examples
```python
from otime import analyze_time_complexity

# Example usage
def example_input_generator(size):
    """Generate a list of given size for testing."""
    return size

def func(n):
    for i in range(n):
        j = i * i
        while j > 0:
            j //= 4

sizes = [100, 200, 400, 800, 1600, 3200]
complexity, r_squared = analyze_time_complexity(
    func, 
    example_input_generator,
    sizes,
    save_plot=True
)
print(f"\nResults:")
print(f"Detected time complexity: {complexity}")
print(f"R-squared value: {r_squared:.4f}")
```

## Features
- Automatic time complexity detection
- Visual plotting of results
- Support for common complexity classes
- Robust numerical analysis

## License
MIT License
