https://prefect.io logo
Title
a

Abosede Oladipo

12/28/2022, 1:47 PM
Hello everyone Is there a way to get a list of all blocks in a workspace using Python code? I know that it can be done via the cli with
prefect block ls
, but I can't seem to find anything in the docks using python code.
1
p

Peyton Runyan

12/28/2022, 2:55 PM
blocks = await client.read_block_documents()
In general, if it can be done from the CLI, there's an associated client method that can be found in our client docs: https://docs.prefect.io/api-ref/prefect/client/
🔥 1
a

Abosede Oladipo

12/28/2022, 3:15 PM
Thanks Peyton!
👍 1