@Marvin How can I access Prefect environment variables within my code?
m
Marvin
01/07/2025, 9:47 PM
To access Prefect environment variables within your code, you can use the Prefect Python SDK. You can interact with variables using methods like
get
,
set
, and
unset
. These methods can be used synchronously in a standard Python context or asynchronously in an asynchronous context.
Environment variables in Prefect are prefixed with
PREFECT_
and take precedence over other configuration sources, making them useful for temporary overrides or session-specific settings.
For more details, you can refer to the Prefect documentation on variables and settings and profiles.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.