Metadata-Version: 2.4
Name: gradlog
Version: 0.1.1
Summary: Python SDK for Gradlog ML experiment tracking
Author: Gradlog Team
License: MIT
Project-URL: Homepage, https://github.com/gradlog/gradlog
Project-URL: Documentation, https://github.com/gradlog/gradlog#readme
Project-URL: Repository, https://github.com/gradlog/gradlog
Project-URL: Issues, https://github.com/gradlog/gradlog/issues
Keywords: mlops,machine-learning,experiment-tracking,ml
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: urllib3>=1.26.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"

# Gradlog Python SDK

Python SDK for [Gradlog](https://github.com/gradlog/gradlog) ML experiment tracking.

## Installation

```bash
pip install gradlog
```

## Quick Start

```python
import gradlog

# Initialize the client with your API key
client = gradlog.Client(
    host="https://your-gradlog-instance.com",
    api_key="gl_your_api_key"
)

# Create or get a project
project = client.get_or_create_project("my-ml-project")

# Create or get an experiment
experiment = project.get_or_create_experiment("hyperparameter-search")

# Start a run
with experiment.start_run(name="run-001") as run:
    # Log parameters
    run.log_params({
        "learning_rate": 0.001,
        "batch_size": 32,
        "epochs": 100
    })
    
    # Log metrics during training
    for epoch in range(100):
        loss = train_epoch()
        run.log_metric("loss", loss, step=epoch)
        run.log_metric("accuracy", evaluate(), step=epoch)
    
    # Log artifacts
    run.log_artifact("model.pt", "/path/to/model.pt")
    
    # Run automatically completes when exiting the context
```

## Using Raw HTTP API

You can also use the SDK to make raw API calls:

```python
import gradlog

client = gradlog.Client(
    host="https://your-gradlog-instance.com",
    api_key="gl_your_api_key"
)

# Make raw API calls
response = client.get("/api/v1/projects")
projects = response.json()
```

## Environment Variables

The SDK supports configuration via environment variables:

- `GRADLOG_HOST`: The Gradlog server URL
- `GRADLOG_API_KEY`: Your API key

```python
import gradlog

# Will use environment variables
client = gradlog.Client()
```

## License

MIT


