Verify where files are stored

The following script prints the storage locations of all files in a Project. This includes the cloud storage locations for private cloud data, and Encord storage location for local data in the Project. Knowing where your files are storage helps to cross-verify that all data from a cloud bucket has been added to the Project.

ℹ️

Note

To learn how to view the storage locations of all files in a Dataset, see our documentation here.

In the following script, ensure that you:

  • Replace <private_key_path> with the path to your private key.
  • Replace <project_hash> with the hash of the Project you want to know the storage locations for.
# Import dependencies
from encord import EncordUserClient

# Instantiate client

user_client = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path="<private_key_path>"
)

# Specify Project. Replace <project_hash> with the hash of your Project
project = user_client.get_project(
    project_hash="<project_hash>"
    )

# Print Storage locations
for log_line in project.list_label_rows_v2():
    data_list = project.get_data(log_line.data_hash, get_signed_url=True)
    print(data_list)
({'title': 'chicken-egg_normalized.mp4', 'file_link': 'https://storage.googleapis.com/cord-ai-platform.appspot.com/cord-videos-prod/iaDJxNNrMuQMtFPcP9oszw2OCHm2/d45a91e5-c5f1-470d-86f7-4c2983bfd8d9.mp4?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=firebase-adminsdk-64w1p%40cord-ai-platform.iam.gserviceaccount.com%2F20240215%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240215T110647Z&X-Goog-Expires=604800&X-Goog-SignedHeaders=host&X-Goog-Signature=3f315152fd19b092fafe39713ec01aea2b71a49dba66536e187bdc0b801c01384872104bd0d043eec79c912f40bc32a1a9275f20272ac550b7737432034d9387073f8053a02b2e02db18c9bf925a42ca253af6e62f6b25fc56d49c662cb3383ffdc75c730bad0c79a8ab0c821d6ec460d7bd6a31e93495ffd16aaa8f56e440d7de90d9561b3b2d6098e1923100feacb10c65d94d44b7c44b0c9e09d730c3702c7f3163826906a147e8e469f9158c6ac6f8f2e14b2d0334875f7051c3fe8c8504827ded116163c9afccee84b33f4f5298f1b47d24edf77d210f61626900cf136bbe7dbf738065e450301ae6ee8c79288b66111e9448771b04f26a4e697cadafb0'}, None)