anystore.model
Info
Bases: BaseModel
Streamline fs.info()
Source code in anystore/model/info.py
created_at = Field(default=None, validation_alias=(AliasChoices(*CREATED_AT_CHOICES)))
class-attribute
instance-attribute
Created at timestamp
name
instance-attribute
Key name: last part of the key (aka file name without path)
size
instance-attribute
Size (content length) in bytes
updated_at = Field(default=None, validation_alias=(AliasChoices(*UPDATED_AT_CHOICES)))
class-attribute
instance-attribute
Last updated timestamp
ensure_timestamp_fallback()
Fall back created_at <-> updated_at.
Source code in anystore/model/info.py
Stats
Bases: Info
Meta information for a store key
Source code in anystore/model/info.py
key
instance-attribute
Full path of key
mimetype
instance-attribute
Mime type for that key
store
instance-attribute
Store base uri
uri
property
Computed uri property from store uri and key.
Returns:
| Type | Description |
|---|---|
str
|
e.g. |
ensure_mimetype(values)
classmethod
Extract mimetype from fsspec info dict headers.
Source code in anystore/model/info.py
StoreModel
Bases: BaseModel
Store model to initialize a store from configuration
Source code in anystore/model/store.py
backend_config = {}
class-attribute
instance-attribute
Backend-specific configuration to pass through for initialization
default_ttl = settings.default_ttl
class-attribute
instance-attribute
Default ttl for keys (only backends that support it: redis, sql, ..)
deserialization_func = None
class-attribute
instance-attribute
Default deserialization function
is_fslike
cached
property
Check if it is a file-like store usable with fsspec
is_http
cached
property
Check if it is a http(s) remote store
is_local
cached
property
Check if it is a local file store
is_s3
cached
property
Check if it is a s3 (compatible) remote store
is_sql
cached
property
Check if it is a sql-like store (sqlite, postgres, ...)
model = None
class-attribute
instance-attribute
Default pydantic model for serialization
raise_on_nonexist = settings.raise_on_nonexist
class-attribute
instance-attribute
Raise anystore.exceptions.DoesNotExist if key doesn't exist
serialization_func = None
class-attribute
instance-attribute
Default serialization function
serialization_mode = settings.serialization_mode
class-attribute
instance-attribute
Default serialization (auto, raw, pickle, json)
store_none_values = True
class-attribute
instance-attribute
Store None as value in store
uri
instance-attribute
Store base uri