{
"info": {
"author": "Jordan Eremieff",
"author_email": "jordan@eremieff.com",
"bugtrack_url": null,
"classifiers": [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7"
],
"description": "# asgi-s3\n\n\n \n\n\n
\n\n\n\nStatic file management tools and [ASGI](https://asgi.readthedocs.io/en/latest/) middleware support for [Amazon S3](https://aws.amazon.com/s3/). \n\n**Work in Progress**: A lot of what is here currently will be changing, not recommended for any serious usage at this point.\n\n**Requirements**: Python 3.6+\n\n## Installation\n\n```shell\npip install asgi-s3\n```\n\n...but you probably just want to clone the `master` branch for the moment.\n\n## CLI\n\n```shell\ns3 create-bucket Create a new S3 bucket.\n\ns3 list-buckets List all S3 buckets.\n\ns3 sync-bucket Sync a bucket with a local static file directory.\n```\n\n...todo\n\n## Middleware\n\nThe middleware is designed to work with any ASGI application. Here is raw ASGI example:\n\n```python\nfrom asgi_s3.middleware import S3StorageMiddleware, s3_url_for\n\n\nAWS_ACCESS_KEY_ID = \"access-key-id\"\nAWS_SECRET_ACCESS_KEY = \"secret-access-key\"\nBUCKET_NAME = \"my-bucket\"\nREGION_NAME = \"region-name\"\nSTATIC_DIR = \"path/to/static/files\"\n\n\nasync def app(scope, receive, send):\n await send(\n {\n \"type\": \"http.response.start\",\n \"status\": 200,\n \"headers\": [[b\"content-type\", b\"text/html; charset=utf-8\"]],\n }\n )\n html_content = f\"\"\"\n \n \n