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
- Create a fake credentials file (
fake_credentials):
AWSAccessKeyId=12345
AWSSecretKey=12345
- Set the credentials environment variable:
export AWS_CREDENTIAL_FILE="path/to/fake_credentials"
- Start the server:
python -m locals3server
- 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.
Metadata
Release files for local-s3-server 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| local_s3_server-0.2.2.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| local_s3_server-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.4 kB
Release files / local_s3_server-0.2.2.tar.gz
| Download URL | local_s3_server-0.2.2.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4b1049c19b6170720f640a80a11535e3692145cb7bb8cef22ac751f388acb88
|
|
BLAKE2b-256 checksum How to use checksums |
ac7cf99d848072d1e5db246a93f7257d2e63d8c637b94b516df95d152a700c4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / local_s3_server-0.2.2-py3-none-any.whl
| Download URL | local_s3_server-0.2.2-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5996049bae81d52d643f0c2559c5434f9f87508dfec5e3c0758ed0c51a6c6ec5
|
|
BLAKE2b-256 checksum How to use checksums |
2486c4a078b73b93960b968a7656b7487276351678b6cc5ff35cea8bc32ea65d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|