Skip to main content

A lightweight, FastAPI-based S3-compatible server for local development and testing

Project description

Local S3 Server

A lightweight, FastAPI-based S3-compatible server designed for local development and testing. Perfect for developing and testing S3-dependent applications without connecting to actual AWS services.

Features

  • S3-compatible API implementation
  • Local storage for S3 buckets and objects
  • FastAPI-powered for modern async support
  • Simple configuration and setup
  • Perfect for testing and development environments
  • No AWS account required

Installation

pip install local-s3-server

Quick Start

  1. Create a fake credentials file (fake_credentials):
AWSAccessKeyId=12345
AWSSecretKey=12345
  1. Set the credentials environment variable:
export AWS_CREDENTIAL_FILE="path/to/fake_credentials"
  1. Start the server:
python -m locals3server
  1. Use with any S3 client by pointing to the local endpoint:
import boto3

s3 = boto3.client('s3',
    endpoint_url='http://localhost:10001',
    aws_access_key_id='12345',
    aws_secret_access_key='12345'
)

Configuration

The server can be configured using environment variables:

  • LOCAL_S3_HOST: Host to bind (default: localhost)
  • LOCAL_S3_PORT: Port to listen on (default: 10001)
  • LOCAL_S3_STORAGE: Storage directory (default: ~/.local-s3-server)

Examples

The examples directory contains sample code for common operations:

  • Creating buckets and objects
  • Uploading and downloading files
  • Listing buckets and objects
  • Deleting objects
  • Working with nested paths
  • Image handling

See the examples directory for complete examples.

Development

To set up the development environment:

git clone https://github.com/yourusername/local-s3-server.git
cd local-s3-server
pip install -e ".[dev]"
pytest

Attribution

This project is a modernized fork of PyS3Local, which itself was derived from mock-s3 (a Python port of Fake-S3). The codebase has been significantly enhanced with FastAPI integration and modern Python practices.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

local_s3_server-0.2.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

local_s3_server-0.2.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file local_s3_server-0.2.2.tar.gz.

File metadata

  • Download URL: local_s3_server-0.2.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for local_s3_server-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d4b1049c19b6170720f640a80a11535e3692145cb7bb8cef22ac751f388acb88
MD5 292af42f6597a3142381a5cca7e5f1e0
BLAKE2b-256 ac7cf99d848072d1e5db246a93f7257d2e63d8c637b94b516df95d152a700c4e

See more details on using hashes here.

File details

Details for the file local_s3_server-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for local_s3_server-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5996049bae81d52d643f0c2559c5434f9f87508dfec5e3c0758ed0c51a6c6ec5
MD5 a4afad79d11b6d514c3cea2d70e493b4
BLAKE2b-256 2486c4a078b73b93960b968a7656b7487276351678b6cc5ff35cea8bc32ea65d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page