Metadata-Version: 2.1
Name: pypiserver-backend-s3
Version: 0.0.2
Summary: A pypiserver backend for storing packages directly to S3 (using boto3)
Author-email: Estelle Poulin <dev@inspiredby.es>
License: MIT
Project-URL: homepage, https://github.com/estheruary/pypiserver-backend-s3
Project-URL: repository, https://github.com/estheruary/pypiserver-backend-s3
Project-URL: changelog, https://github.com/estheruary/pypiserver-backend-s3/blob/main/README.md
Keywords: pypiserver
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: boto3 ==1.28.32

# pypiserver-backend-s3

A pypiserver backend for storing packages directly to S3 or S3 like services (using boto3).

**This is for use with [`pypiserver-pluggable-backends`](https://github.com/estheruary/pypiserver-pluggable-backends).**

## Installation

```bash
pip install pypiserver-pluggable-backends pypiserver-backend-s3
```

Verify that that you can see the backend with the `pypi-server backends` command.


## Running

The basic usage is actually pretty simple.

```bash
export AWS_ACCESS_KEY=""
export AWS_SECRET_ACCESS_KEY=""

pypi-server run --backend=s3 --backend-set bucket=mybucketname prefix=pypiserver
```

You can also specify these as command line args.

```bash
pypi-server run --backend=s3 \
  --backend-set \
    bucket=mybucketname \
    prefix=pypiserver \
    access_key="" \
    secret_access_key=""
```


## No Thoughts Just Try It

```bash
aws-vault exec myprofile -- pypi-server run -P . -a . --backend=s3 --backend-set bucket=mybucket prefix=myprefix

curl http://localhost:8080/packages/

# In this repo.
python -m build
twine upload --repository-url http://localhost:8080/ dist/*

curl http://localhost:8080/packages/

pip install pypiserver-backend-s3 --extra-index-url=http://localhost:8080
```

## Running With Backblaze 

To run with Backblaze (B2) just set the `endpoint` option.

```bash
pypi-server run --backend=s3 \
  --backend-set \
    bucket=mybucketname \
    prefix=pypiserver \
    access_key="<b2_keyId>" \
    secret_access_key="<b2_appKey>"
    endpoint="https://s3.us-west-002.backblazeb2.com"
```

