Metadata-Version: 2.4
Name: embedl-hub
Version: 0.0.8
Summary: The official Embedl Hub Python client library.
Author-email: Embedl AB <support@embedl.com>
Project-URL: Homepage, https://hub.embedl.com
Project-URL: Documentation, https://hub.embedl.com/docs
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: packaging>=21.0
Requires-Dist: platformdirs>=4.5
Requires-Dist: pydantic>=2.8.2
Requires-Dist: PyYAML~=6.0.2
Requires-Dist: requests>=2.32.3
Requires-Dist: rich>=13.7
Requires-Dist: typer>=0.12.0
Requires-Dist: typing-extensions>=4.15.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Provides-Extra: docs
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: pydata-sphinx-theme; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-click; extra == "docs"
Dynamic: license-file

# Embedl Hub Python library

`embedl-hub` is the Python client and command-line interface for
[Embedl Hub](https://hub.embedl.com), a shared platform for developing and
validating physical AI. It records your work as runs in a Hub project, with
their parameters, metrics, tags, and files, from your own Python code or from
the shell. The [documentation](https://hub.embedl.com/docs) explains the
concepts and covers the full feature set.

## Installation

Python 3.10 or newer.

```shell
pip install embedl-hub
```

This installs the `embedl_hub` package and the `embedl-hub` command (`ehub`
for short).

## Set up access

Create a key on your [API keys page](https://hub.embedl.com/account/api-keys),
then store it:

```shell
embedl-hub auth --api-key <your-key>
```

See [SDK setup](https://hub.embedl.com/docs/setup) for self-hosted Hubs and
[Configuration](https://hub.embedl.com/docs/configuration) for the environment
variables to use in CI.

## Track from Python

```python
from pathlib import Path

from embedl_hub.tracking import Client

client = Client()                                       # uses the stored API key
client.set_project("my-project")                        # the project to record runs in

with client.start_run("eval", name="Baseline") as run:  # finished when the block ends
    client.log_param("model", "resnet18")               # a setting
    client.log_metric("accuracy", 0.923, step=1)        # a measurement
    client.log_tag("stage", "baseline")                 # a label
    Path("predictions.json").write_text("[]")           # a file to upload
    client.log_artifact("predictions.json")             # uploads it

print(run.id)                                           # the run's ID
```

See [Direct tracking](https://hub.embedl.com/docs/direct-tracking) for
everything a `Client` can record, and
[Decorator tracking](https://hub.embedl.com/docs/decorator-tracking) for
tracking a pipeline of Python functions.

## Track from the shell

```shell
embedl-hub use project my-project              # the project for this directory
embedl-hub run start --type eval --use         # starts a run and prints its URL
embedl-hub log param model resnet18            # a setting
embedl-hub log metric accuracy 0.923 --step 1  # a measurement
embedl-hub log tag stage baseline              # a label
embedl-hub log artifact predictions.json       # uploads a file
embedl-hub run finish                          # ends the run
```

See the [CLI guide](https://hub.embedl.com/docs/cli) for the rest, or run
`embedl-hub --help`.

## Project status

`embedl-hub` is under active development. The public API may change between
releases in the 0.0.x series, so pin an exact version for a reproducible build.

## Support

For questions, bug reports, and feedback, contact <support@embedl.com>.

## License

This software is subject to the
[Embedl Hub Software License Agreement](https://hub.embedl.com/embedl-hub-sla.txt).
