Metadata-Version: 2.4
Name: uptimely-core
Version: 0.11.0
Summary: Manage data science with complex dependencies at scale
License-Expression: MIT
License-File: LICENSE
Keywords: analytics,declarative,industrial,feature-engineering,polars
Author: Mikael Ahonen
Author-email: mikael.ahonen@uptimely.ai
Requires-Python: >=3.13,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Provides-Extra: mcp
Provides-Extra: s3
Requires-Dist: boto3 (>=1.34,<2.0) ; extra == "s3"
Requires-Dist: docstring-parser (>=0.18,<0.19)
Requires-Dist: fastapi (>=0.115,<1.0)
Requires-Dist: fastmcp (>=2.12,<5.0) ; extra == "mcp"
Requires-Dist: graphable (>=0.6.1,<0.8)
Requires-Dist: numpy (>=1.26,<3.0)
Requires-Dist: polars (>=1.0,<2.0)
Requires-Dist: pydantic (>=2.10,<3.0)
Requires-Dist: uvicorn (>=0.34,<1.0)
Project-URL: Documentation, https://uptimely-ai.github.io/uptimely-core
Project-URL: Homepage, http://uptimely.ai/core/
Project-URL: Repository, https://github.com/uptimely-ai/uptimely-core
Description-Content-Type: text/markdown

# Uptimely Core

Uptimely Core is an open source framework for managing interdependent data science calculations.

The goal is to free data science teams to focus on advanced analytics, mathematics, and modeling. Teams define their analytics in pure Python, while Uptimely Core minimizes the effort required for project setup, dependency modeling, debugging, testing, and validation.

Uptimely Core helps teams manage complex networks of analytical calculations, features, and dimensional hierarchies. Just as importantly, it makes dependencies on people, processes, and decisions easier to understand and manage.

Uptimely applies data-modeling best practices to organize data science into profiles. Each profile defines its dimensional grain, row scope, and set of features. Computational operators use profile metadata to define feature dependencies and bind functions, which are then used to materialize the resulting dataset.

Author the data science workflow in Python. Build and run from command line. Explore from web browser.

> [!WARNING]
> This project is still at version `0.x`: minor
> releases may include breaking changes. See the [changelog](https://github.com/uptimely-ai/uptimely-core/blob/main/CHANGELOG.md)
> for details.

## Demo

Browse the [example project explorer](https://uptimely-ai.github.io/uptimely-core/example/).

Screenshot from the web explorer:

![Uptimely Core Demo](https://uptimely-public.s3.pl-waw.scw.cloud/uptimely-demo/uptimely-core/uptimely-core-feature-lineage.png)

Materialized results from Uptimely engine run:

![Uptimely run preview](https://uptimely-public.s3.pl-waw.scw.cloud/uptimely-demo/uptimely-core/uptimely-core-run-preview.png)

More business benefits at [uptimely.ai/core/](https://uptimely.ai/core/).

## Documentation

* [The full documentation site](https://uptimely-ai.github.io/uptimely-core/)
* [Python API reference](https://uptimely-ai.github.io/uptimely-core/python/)
* [CLI API reference](https://uptimely-ai.github.io/uptimely-core/cli/)
* [MCP API and AI chat setup](https://uptimely-ai.github.io/uptimely-core/guides/ai-setup/)

## Install

Python 3.13 or newer is required.

**Install in existing Python environment**

Install Uptimely Core with the command that matches your tooling:

```sh
pip install uptimely-core
```

```sh
poetry add uptimely-core
```

```sh
uv add uptimely-core
```

**Create a new Python environment**

Go to your project directory.

If uv is not installed, [install it](https://docs.astral.sh/uv/getting-started/installation/) on macOS or Linux:

```sh
curl -LsSf https://astral.sh/uv/install.sh | sh
```

Restart your shell if `uv` is not found.

```sh
uv init --bare --python 3.13
uv add uptimely-core
```

## Build and run

Go to your project root. The following commands assume an active Python environment.

For Poetry use `poetry run uptimely <command>`.

For uv use `uv run uptimely <command>`.

Download the example project's code into the current directory without setup files.
The download does not overwrite existing files.

```sh
uptimely example --no-setup --dir .
```

Create a build from the specification.

```sh
uptimely build
```

Run the data science pipeline using the build.

```sh
uptimely run
```

## Explore the project

Explore resources and results in the local web app:

```sh
uptimely explore
```

Read more about [example project](https://uptimely-ai.github.io/uptimely-core/intro/example-project/) from the docs.

Open the project in a code editor, modify the code, build and run it again and explore the new results.

## Python API

The previous example was built by the [Python-authored example specification](https://github.com/uptimely-ai/uptimely-core/tree/main/example). The specification describes profiles, grains, features and operators. Functions remain pure Python.

Here is even more simplified example.

Store this code to `spec/spec.py`

```python
import polars as pl
import uptimely as up


def read_values() -> pl.DataFrame:
    return pl.DataFrame(
        {
            "id": [1, 2],
            "value": [10, 20],
        }
    )


def double(dataset: pl.LazyFrame, value: str, output: str) -> pl.LazyFrame:
    return dataset.with_columns((pl.col(value) * 2).alias(output))


def print_results(dataset: pl.DataFrame) -> None:
    print(dataset)


measurement_id = up.Dimension(
    id="measurement_id",
    resolutions=[up.Resolution(id="measurement_id", key="id", type="integer")],
)


class MyAnalyticalProfile(up.Profile):
    grain = [measurement_id.resolution("measurement_id")]
    seed = "read_values"

    assembly = [
        up.Operator(
            id="read_values",
            outputs=[up.Feature(id="value")],
            compute=up.Bind(read_values),
        ),
        up.Operator(
            outputs=[up.Feature(id="doubled")],
            compute=up.Bind(
                double,
                dataset=up.ref.dataset(),
                value=up.ref.feature("value"),
                output=up.ref.feature("doubled").id,
            ),
        ),
        up.Operator(
            inputs=[up.ref.feature("doubled")],
            compute=up.Bind(print_results, dataset=up.ref.dataset()),
        ),
    ]


python_spec = up.Spec(
    profiles=[MyAnalyticalProfile],
    name="Analytics Specification",
)
```

Put this code in `run.py`.

```python
from uptimely import Uptimely

app = Uptimely()
app.build()
result = app.run()
```

Run in Python:

```sh
python run.py
```

## Repository guide

| Path | Purpose |
| --- | --- |
| [`docs/`](https://github.com/uptimely-ai/uptimely-core/tree/main/docs) | Architecture, specification, and development documentation. |
| [`example/`](https://github.com/uptimely-ai/uptimely-core/tree/main/example) | Runnable examples and generated artifacts. |
| [`scripts/`](https://github.com/uptimely-ai/uptimely-core/tree/main/scripts) | Code snippets for repository management |
| [`src/uptimely/`](https://github.com/uptimely-ai/uptimely-core/tree/main/src/uptimely) | Package implementation for analytics, compilation, dependencies, documentation, and execution. |
| [`tests/`](https://github.com/uptimely-ai/uptimely-core/tree/main/tests) | Automated tests for the package and examples. |

## Development

See
[CONTRIBUTING.md](https://github.com/uptimely-ai/uptimely-core/blob/main/CONTRIBUTING.md) for the full workflow.

## License

Released under the [MIT license](https://github.com/uptimely-ai/uptimely-core/blob/main/LICENSE). Contributions are welcome — see [CONTRIBUTING.md](https://github.com/uptimely-ai/uptimely-core/blob/main/CONTRIBUTING.md).

## Feedback

We are happy to hear development ideas, bug reports and other form of feedback.

Find the contact details from [Uptimely website](https://uptimely.ai).

