prefect.blocks.system
DateTime
Bases: Block
A block that represents a datetime. Deprecated, please use Variables to store datetime data instead.
Attributes:
Name | Type | Description |
---|---|---|
value |
DateTime
|
An ISO 8601-compatible datetime value. |
Example
Load a stored JSON value:
from prefect.blocks.system import DateTime
data_time_block = DateTime.load("BLOCK_NAME")
Source code in src/prefect/blocks/system.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
JSON
Bases: Block
A block that represents JSON. Deprecated, please use Variables to store JSON data instead.
Attributes:
Name | Type | Description |
---|---|---|
value |
Any
|
A JSON-compatible value. |
Example
Load a stored JSON value:
from prefect.blocks.system import JSON
json_block = JSON.load("BLOCK_NAME")
Source code in src/prefect/blocks/system.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
Secret
Bases: Block
, Generic[T]
A block that represents a secret value. The value stored in this block will be obfuscated when this block is viewed or edited in the UI.
Attributes:
Name | Type | Description |
---|---|---|
value |
Union[SecretStr, Secret[T]]
|
A value that should be kept secret. |
Example
from prefect.blocks.system import Secret
Secret(value="sk-1234567890").save("BLOCK_NAME", overwrite=True)
secret_block = Secret.load("BLOCK_NAME")
# Access the stored secret
secret_block.get()
Source code in src/prefect/blocks/system.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
String
Bases: Block
A block that represents a string. Deprecated, please use Variables to store string data instead.
Attributes:
Name | Type | Description |
---|---|---|
value |
str
|
A string value. |
Example
Load a stored string value:
from prefect.blocks.system import String
string_block = String.load("BLOCK_NAME")
Source code in src/prefect/blocks/system.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|