Metadata-Version: 2.4
Name: local-s3-server
Version: 0.2.2
Summary: A lightweight, FastAPI-based S3-compatible server for local development and testing
Project-URL: Homepage, https://github.com/oeway/local-s3-server
Project-URL: Repository, https://github.com/oeway/local-s3-server.git
Author-email: Wei Ouyang <oeway007@gmail.com>
License: MIT
Keywords: development,fastapi,mock,s3,testing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Requires-Dist: fastapi>=0.68.0
Requires-Dist: python-multipart>=0.0.5
Requires-Dist: uvicorn>=0.15.0
Provides-Extra: dev
Requires-Dist: black>=21.0; extra == 'dev'
Requires-Dist: flake8>=3.9; extra == 'dev'
Requires-Dist: isort>=5.0; extra == 'dev'
Requires-Dist: mypy>=0.910; extra == 'dev'
Requires-Dist: pytest-cov>=2.0; extra == 'dev'
Requires-Dist: pytest>=6.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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

```bash
pip install local-s3-server
```

## Quick Start

1. Create a fake credentials file (`fake_credentials`):
```ini
AWSAccessKeyId=12345
AWSSecretKey=12345
```

2. Set the credentials environment variable:
```bash
export AWS_CREDENTIAL_FILE="path/to/fake_credentials"
```

3. Start the server:
```bash
python -m locals3server
```

4. Use with any S3 client by pointing to the local endpoint:
```python
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](./examples) for complete examples.

## Development

To set up the development environment:

```bash
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.
