Skip to main content

Add your description here

Project description

Digilog Python Client

A Python client for Digilog experiment tracking with a wandb-like interface.

Installation

pip install digilog

Or install from source:

git clone https://github.com/digilog/digilog-python.git
cd digilog-python
pip install -e .

Quick Start

import digilog

# Initialize digilog (similar to wandb.init)
run = digilog.init(
    project="my-ml-project",
    name="experiment-1",
    config={
        "learning_rate": 0.001,
        "batch_size": 32,
        "epochs": 100
    }
)

# Log metrics during training
for epoch in range(100):
    loss = train_epoch()
    accuracy = evaluate()
    
    run.log({
        "loss": loss,
        "accuracy": accuracy,
        "epoch": epoch
    })

# Finish the run
run.finish()

API Reference

digilog.init()

Initialize a new experiment run.

digilog.init(
    project: str,           # Project name
    name: str = None,       # Run name (optional)
    config: dict = None,    # Configuration parameters
    group: str = None,      # Group name for related runs
    tags: list = None,      # Tags for organization
    notes: str = None,      # Description/notes
    **kwargs
) -> Run

run.log()

Log metrics and other data.

run.log(
    data: dict,             # Dictionary of metrics to log
    step: int = None        # Step number (optional)
)

run.config

Access or update configuration parameters.

# Set config values
run.config.update({"new_param": "value"})

# Get config values
learning_rate = run.config.learning_rate

run.finish()

Finish the current run.

run.finish()

Advanced Usage

Multiple Runs

import digilog

# Create multiple runs
for lr in [0.001, 0.01, 0.1]:
    run = digilog.init(
        project="hyperparameter-tuning",
        name=f"lr-{lr}",
        config={"learning_rate": lr}
    )
    
    # Training loop
    for epoch in range(100):
        loss = train_epoch()
        run.log({"loss": loss, "epoch": epoch})
    
    run.finish()

Custom Step Logging

import digilog

run = digilog.init(project="my-project")

for step in range(1000):
    # Your training code here
    loss = model.train_step()
    
    # Log with custom step
    run.log({
        "loss": loss,
        "learning_rate": scheduler.get_last_lr()[0]
    }, step=step)

run.finish()

Configuration Management

import digilog

# Initialize with config
run = digilog.init(
    project="config-test",
    config={
        "model": "resnet50",
        "optimizer": "adam",
        "learning_rate": 0.001
    }
)

# Update config during run
run.config.update({
    "batch_size": 64,
    "epochs": 200
})

# Access config values
print(f"Learning rate: {run.config.learning_rate}")

Authentication

The client requires authentication via a session token. You can set this in several ways:

  1. Environment variable:

    export DIGILOG_API_KEY="your-session-token"
    
  2. In your code:

    import digilog
    digilog.set_token("your-session-token")
    
  3. Login via CLI:

    digilog login
    

Error Handling

The client handles common errors gracefully:

import digilog

try:
    run = digilog.init(project="my-project")
    run.log({"metric": 0.95})
    run.finish()
except digilog.DigilogError as e:
    print(f"Digilog error: {e}")
except Exception as e:
    print(f"Unexpected error: {e}")

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_digilog-0.0.5.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_digilog-0.0.5-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file python_digilog-0.0.5.tar.gz.

File metadata

  • Download URL: python_digilog-0.0.5.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for python_digilog-0.0.5.tar.gz
Algorithm Hash digest
SHA256 289b441be69dc7d36ebfa94472324cc1b764765b56fbbeeee386cf6e95cae0f4
MD5 04e8762dcf6f2689fb684ea2c2357d52
BLAKE2b-256 f20252985a7b05ceae90a898fea29dda2c76ba738ec5d24010df2ad0a99d6f35

See more details on using hashes here.

File details

Details for the file python_digilog-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: python_digilog-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for python_digilog-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 982befa93cc550548f55a941945ae70b82877c686bed6a540a9cc0ea9d3916cc
MD5 731334df6f3a4312e39e286efa0bdabe
BLAKE2b-256 fa514ea46df5b59ab9741e8a63fcd6dc69067646a3937456feb52bd57cd21d1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page