Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cariad/webup
Python package for uploading website files to AWS S3
https://github.com/cariad/webup
amazon-web-services aws-s3 python websites
Last synced: about 16 hours ago
JSON representation
Python package for uploading website files to AWS S3
- Host: GitHub
- URL: https://github.com/cariad/webup
- Owner: cariad
- License: mit
- Created: 2021-12-23T16:20:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-08T02:37:23.000Z (over 1 year ago)
- Last Synced: 2024-09-25T12:26:20.463Z (8 days ago)
- Topics: amazon-web-services, aws-s3, python, websites
- Language: Python
- Homepage: https://cariad.github.io/webup/webup.html
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# WebUp
[![CircleCI](https://circleci.com/gh/cariad/webup/tree/main.svg?style=shield)](https://circleci.com/gh/cariad/webup/tree/main) [![codecov](https://codecov.io/gh/cariad/webup/branch/main/graph/badge.svg?token=Gkqtgno072)](https://codecov.io/gh/cariad/webup)
**WebUp** is a Python package for uploading websites to Amazon Web Services S3
buckets.- Uploads files and subdirectories
- Multi-threaded for concurrent parallel uploads
- Sets Cache-Control and Content-Type headers**Full documentation is online at [cariad.github.io/webup](https://cariad.github.io/webup/webup.html).**
## Installation
```bash
pip install webup
```## Usage
To upload a directory with the default configuration:
```python
from webup import uploadupload("./public", "my-bucket")
```If the bucket's name is recorded in Systems Manager, pass a parameter name instead of a bucket name:
```python
from webup import uploadupload("./public", ssm_param="/my-platform/buckets/website")
```Some content types are baked-in. To add more content types:
```python
from webup import set_content_type, uploadset_content_type(".foo", "application/foo")
upload("./public", "my-bucket")
```All files have the Cache-Control value "max-age=60" by default. To configure this:
```python
from webup import set_default_maximum_age, set_maximum_age, upload# Serve sw.js with Cache-Control "max-age=0":
set_maximum_age(r"^sw\.js$", 0)# Serve all other JavaScript with Cache-Control "max-age=600":
set_maximum_age(r"^.*\.js$", 600)# Serve all other files with Cache-Control "max-age=300":
set_default_maximum_age(300)upload("./public", "my-bucket")
```To perform a dry-run:
```python
from webup import uploadupload("./public", "my-bucket", read_only=True)
```**Full documentation is online at [cariad.github.io/webup](https://cariad.github.io/webup/webup.html).**
## Licence
WebUp is released at [github.com/cariad/webup](https://github.com/cariad/webup) under the MIT Licence.
See [LICENSE](https://github.com/cariad/webup/blob/main/LICENSE) for more information.
## Author
Hello! 👋 I'm **Cariad Eccleston** and I'm a freelance DevOps and backend engineer. My contact details are available on my personal wiki at [cariad.earth](https://cariad.earth).
Please consider supporting my open source projects by [sponsoring me on GitHub](https://github.com/sponsors/cariad/).