Hello everyone Is there a way to get a list of all...
# ask-community
a
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
Copy code
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
Thanks Peyton!
👍 1