board_s3

board_s3(path, versioned=True, cache=DEFAULT, allow_pickle_read=None, **storage_options)

Create a board to read and write pins from an AWS S3 bucket folder.

Parameters

Name Type Description Default
path Path of form <bucket_name>/<optional>/<subdirectory>. required
versioned Whether or not pins should be versioned. True
cache Whether to use a cache. By default, pins attempts to select the right cache directory, given your filesystem. If None is passed, then no cache will be used. You can set the cache using the PINS_CACHE_DIR environment variable. DEFAULT
allow_pickle_read Whether to allow reading pins that use the pickle protocol. Pickles are unsafe, and can execute arbitrary code. Only allow reading pickles if you trust the board to execute Python code on your computer. You can enable reading pickles by setting this to True, or by setting the environment variable PINS_ALLOW_PICKLE_READ. If both are set, this argument takes precedence. None
storage_options Additional keyword arguments to be passed to the underlying fsspec S3FileSystem. {}

Notes

The s3 board uses the fsspec library (s3fs) to handle interacting with AWS S3. In order to authenticate, set the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and (optionally) AWS_REGION environment variables. If you are using an s3-compatible storage service that is not from AWS, you can pass in the necessary credentials to the storage_options dictionary, such as endpoint_url, key, and secret. We recommend setting these as environment variables. An example using Backblaze B2 would look like:

Examples

>>> import pins
>>> board = pins.board_s3(
...     "pins-test",
...     endpoint_url=os.getenv("FSSPEC_S3_ENDPOINT_URL"),
...     key=os.getenv("FSSPEC_S3_KEY"),
...     secret=os.getenv("FSSPEC_S3_SECRET"),
... )

See https://github.com/fsspec/s3fs