Metadata-Version: 2.4
Name: apache-hamilton-sdk
Version: 0.9.0.dev0
Summary: Apache Hamilton SDK for reading and writing to the Apache Hamilton backend APIs that support the UI.
Keywords: hamilton,dagworks,observability
Author-email: Stefan Krawczyk <stefank@cs.stanford.edu>, Elijah ben Izzy <elijah@dagworks.io>
Requires-Python: >=3.10, <4
Description-Content-Type: text/markdown
License-Expression: Apache-2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
License-File: DISCLAIMER
License-File: LICENSE
License-File: NOTICE
Requires-Dist: aiohttp
Requires-Dist: click
Requires-Dist: gitpython
Requires-Dist: jinja2
Requires-Dist: loguru
Requires-Dist: posthog
Requires-Dist: requests
Requires-Dist: apache-hamilton==1.90.0.dev0
Requires-Dist: sqlglot
Project-URL: documentation, https://hamilton.apache.org/
Project-URL: homepage, https://www.tryhamilton.dev/
Project-URL: issues, https://github.com/apache/hamilton/issues
Project-URL: source, https://github.com/apache/hamilton

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

# Apache Hamilton UI SDK: Client Code &amp; Related

> **Disclaimer**
>
> Apache Hamilton is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC.
>
> Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
>
> While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Welcome to using the Apache Hamilton UI!

Here are instructions on how to get started with tracking, and managing your Apache Hamilton
DAGs with the Apache Hamilton UI.

## Getting Started

For the latest documentation, please consult our
[Apache Hamilton documentation](https://hamilton.apache.org/) under `Apache Hamilton UI`.

For a quick overview of Apache Hamilton, we suggest [tryhamilton.dev](https://www.tryhamilton.dev/).

## Using the HamiltonTracker

First, you'll need to install the Apache Hamilton SDK package. Assuming you're using pip, you
can do this with:

```bash
# install the package & cli into your favorite python environment.
pip install "sf-hamilton[sdk]"

# And validate -- this should not error.
python -c "from hamilton_sdk import adapters"
```

Next, you'll need to modify your Apache Hamilton driver. You'll only need to use one line of code to
replace your driver with ours:

```python
from hamilton_sdk import adapters
from hamilton import driver

tracker = adapters.HamiltonTracker(
   project_id=PROJECT_ID,  # modify this as needed
   username=YOUR_EMAIL, # modify this as needed
   dag_name="my_version_of_the_dag",
   tags={"environment": "DEV", "team": "MY_TEAM", "version": "X"}
)
dr = (
  driver.Builder()
    .with_config(your_config)
    .with_modules(*your_modules)
    .with_adapters(tracker)
    .build()
)
# to run call .execute() or .materialize() on the driver
```
*Project ID*: You'll need a project ID. Create a project if you don't have one, and take the ID from that.

*username*: This is the email address you used to set up the Apache Hamilton UI.

*dag_name*: for a project, the DAG name is the top level way to group DAGs.
E.g. ltv_model, us_sales, etc.

*tags*: these are optional are string key value paris. They allow you to filter and curate
various DAG runs.

Then run Apache Hamilton as normal! Each DAG run will be tracked, and you'll have access to it in the
Apache Hamilton UI. After spinning up the Apache Hamilton UI application, visit it to see your projects & DAGs.


# License
The code here is licensed under the Apache 2.0 license. See the main repository [LICENSE](../../LICENSE) for details.

