minimalkv.net.boto3store module

class minimalkv.net.boto3store.Boto3SimpleKeyFile(s3_object)

Bases: RawIOBase

read(size=-1)
readable() bool

Return whether object was opened for reading.

If False, read() will raise OSError.

seek(offset: int, whence=0) int

Change the stream position to the given byte offset.

offset

The stream position, relative to ‘whence’.

whence

The relative position to seek from.

The offset is interpreted relative to the position indicated by whence. Values for whence are:

  • os.SEEK_SET or 0 – start of stream (the default); offset should be zero or positive

  • os.SEEK_CUR or 1 – current stream position; offset may be negative

  • os.SEEK_END or 2 – end of stream; offset is usually negative

Return the new absolute position.

seekable() bool

Return whether object supports random access.

If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().

property size: int
tell() int

Return current stream position.

class minimalkv.net.boto3store.Boto3Store(bucket, prefix: str | None = None, object_prefix: str = '', url_valid_time: int = 0, reduced_redundancy: bool = False, public: bool = False, metadata=None, create_if_missing=False)

Bases: KeyValueStore, UrlMixin, CopyMixin

iter_keys(prefix: str = '') Iterator[str]

Iterate over all keys in the store starting with prefix.

Parameters

prefixstr, optional, default = ‘’

Only iterate over keys starting with prefix. Iterate over all keys if empty.

Raises

IOError

If there was an error accessing the store.

property prefix: str

Get the prefix used for all keys in this store.

Note

Deprecated in 2.0.0, use object_prefix instead.

minimalkv.net.boto3store.map_boto3_exceptions(key=None, exc_pass=())

Map boto3-specific exceptions to the minimalkv-API.