Package: prefect-hex
prefect-hexVisit the full docshereto see additional examples and the API reference.Welcome!Prefect integrations for interacting with Hex.Hex is a powerful platform for collaborative data science and analytics. For information getting started with Hex, check out Hex'squickstart guide.The tasks within this collection were created by a code generator using Hex's OpenAPI spec.Hex's REST API documentation can be foundhere.Getting StartedPython setupRequires an installation of Python 3.7+.We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to thePrefect documentation.InstallationInstallprefect-hexwithpip:pipinstallprefect-hexA list of available blocks inprefect-hexand their setup instructions can be foundhere.Gather and store authenticationCreate new token onhttps://app.hex.tech/Settings page:Store token onhttps://app.prefect.cloud/Blocks page:Copy project ID from browser URL (in red):Write and run a flowTrigger a Hex project run and wait for completionfromprefectimportflowfromprefect_heximportHexCredentialsfromprefect_hex.projectimporttrigger_project_run_and_wait_for_completion@flowdeftrigger_project_run_and_wait_for_completion_flow(project_id:str):hex_credentials=HexCredentials.load("hex-token")project_metadata=trigger_project_run_and_wait_for_completion(project_id=project_id,hex_credentials=hex_credentials)returnproject_metadatatrigger_project_run_and_wait_for_completion_flow(project_id="012345c6-b67c-1234-1b2c-66e4ad07b9f3")Run project, get status, cancel run, and get list of projectsfromprefectimportflowfromprefect_heximportHexCredentialsfromprefect_hex.projectimport(get_project_runs,run_project,get_run_status,cancel_run,)@flowdefexample_hex_flow():# load stored credentialshex_credentials=HexCredentials.load("hex-token")# run projectproject_id='5a8591dd-4039-49df-9202-96385ba3eff8',project_run=run_project(project_id=project_id,hex_credentials=hex_credentials)# get statusrun_id=project_run.run_idproject_run_status=get_run_status(project_id=project_id,run_id=run_id,hex_credentials=hex_credentials)print(project_run_status.run_url)# cancel run if neededcancel_run(project_id=project_id,run_id=run_id,hex_credentials=hex_credentials)# get list of project runsproject_runs=get_project_runs(project_id=project_id,hex_credentials=hex_credentials)returnproject_runsexample_hex_flow()For more tips on how to use tasks and flows in a Collection, check outUsing Collections!ResourcesBlog PostsCreate Observable and Reproducible Notebooks with Hexby Khuyen TranVideosCreate Observable and Reproducible Notebooks with Hex: Why Hex (Part 1)If you encounter any bugs while usingprefect-hex, feel free to open an issue in theprefect-hexrepository.If you have any questions or issues while usingprefect-hex, you can find help in either thePrefect Discourse forumor thePrefect Slack community.Feel free to star or watchprefect-hexfor updates too!Contributing-```bash
-git clonehttps://github.com/PrefectHQ/prefect-hex.gitIf you'd like to help contribute to fix an issue or add a feature toprefect-hex, pleasepropose changes through a pull request from a fork of the repository.-cd prefect-hex/
Here are the steps:Fork the repositoryClone the forked repositoryInstall the repository and its dependencies:pip install -e ".[dev]"Make desired changesAdd testsInsert an entry toCHANGELOG.mdInstallpre-committo perform quality checks prior to commit:pre-commit installgit commit,git push, and create a pull request install