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.1.tar.gz (10.8 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.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for local_s3_server-0.1.tar.gz
Algorithm Hash digest
SHA256 b7b1ca16cdb92dd715d5c3b3b6cb3ab19cdf5fe984742d772f00a91ab03c0d3f
MD5 fe78228258b1f7fd908563b400303a57
BLAKE2b-256 c8d416db1eca80a0f8a2fe46f714b4396cd45259b87fb316f361e4f519f29ec4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: local_s3_server-0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for local_s3_server-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74edc2946494f27c0ae74de23379b5bfd44f55f999511beb62988068e2adc0dd
MD5 df64db1cbb1abc4bb17571bb7cc630be
BLAKE2b-256 b4f7c2d249a534f60f96c3833d5238ce7ecc97f8d26f76472b3220d180e4f1c1

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