Skip to main content

Hamilton SDK for reading and writing to the Hamilton backend APIs that support the UI.

Project description

Hamilton UI SDK: Client Code & Related

Welcome to using the Hamilton UI!

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

Getting Started

For the latest documentation, please consult our Hamilton documentation under Hamilton UI.

For a quick overview of Hamilton, we suggest tryhamilton.dev.

Using the HamiltonTracker

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

# 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 Hamilton driver. You'll only need to use one line of code to replace your driver with ours:

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 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 Hamilton as normal! Each DAG run will be tracked, and you'll have access to it in the Hamilton UI. After spinning up the Hamilton UI application, visit it to see your projects & DAGs.

License

The code here is licensed under the BSD-3 Clear Clause license. See the main repository LICENSE 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

sf_hamilton_sdk-0.7.3rc0.tar.gz (247.0 kB view details)

Uploaded Source

Built Distribution

sf_hamilton_sdk-0.7.3rc0-py3-none-any.whl (256.7 kB view details)

Uploaded Python 3

File details

Details for the file sf_hamilton_sdk-0.7.3rc0.tar.gz.

File metadata

  • Download URL: sf_hamilton_sdk-0.7.3rc0.tar.gz
  • Upload date:
  • Size: 247.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for sf_hamilton_sdk-0.7.3rc0.tar.gz
Algorithm Hash digest
SHA256 641f6ff4e1576e3d69b86e4b6d8e90d5ebfb30282363ee912df7e01b95c76012
MD5 92c33f340a5ad17e2cf2b9c5336a756b
BLAKE2b-256 0be68a22298c397fb8e6d29d29c8ca09f166a4fcb80d15b68160a39c19e10f83

See more details on using hashes here.

File details

Details for the file sf_hamilton_sdk-0.7.3rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for sf_hamilton_sdk-0.7.3rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 bde66fe3687c5cedf44a72f57259139f6810b9b3544804d035dd0de9daaa7f35
MD5 91354ba6f6836c961bf38502c7770c24
BLAKE2b-256 9dfb875016a2be98ad137bd596b724787a99b5dd0c790cb47cf04005db0088ac

See more details on using hashes here.

Supported by

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