The Client class manages interactions with Replit App Storage. This class features methods for performing operations on objects in a bucket.To import the class from the replit.object_storage package, add the following line to your Python code:
from replit.object_storage import Client
Use the following code to create a Client instance that interacts with Replit App Storage:
client = Client()
If your app uses multiple buckets, create one Client instance per bucket.
The init method initializes an instance of the Client class.
def __init__(bucket_id: Optional[str] = None)
Argument:
bucket_id (Optional[str]): The ID of the bucket the client manages. When omitted, the Client uses the default bucket associated with the Replit App or Deployment.
end_offset(Optional[str]) - Filter results to objects named lexicographically before end_offset. If start_offset is defined, the objects listed
have names between start_offset (inclusive) and end_offset (exclusive).
match_glob (Optional[str]) - Use a glob pattern to filter results. For example: “foo*bar” matches “footbar”, “foo baz bar”, and “foobar”.
max_results (Optional[int]) - The maximum number of results to return in the response.
prefix (Optional[str]) - Filter results to objects whose names have the specified prefix.
start_offset (Optional[str]) - Filter results to objects whose names are lexicographically equal to or after start_offset.
When end_offset is set, the objects listed have names between start_offset (inclusive) and end_offset (exclusive).
Returns:
List(Object): A list of objects matching the given query parameters.