Skip to main content

WebUp

CircleCI codecov

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.

Installation

pip install webup

Usage

To upload a directory with the default configuration:

from webup import upload

upload("./public", "my-bucket")

If the bucket's name is recorded in Systems Manager, pass a parameter name instead of a bucket name:

from webup import upload

upload("./public", ssm_param="/my-platform/buckets/website")

Some content types are baked-in. To add more content types:

from webup import set_content_type, upload

set_content_type(".foo", "application/foo")
upload("./public", "my-bucket")

All files have the Cache-Control value "max-age=60" by default. To configure this:

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:

from webup import upload

upload("./public", "my-bucket", read_only=True)

Full documentation is online at cariad.github.io/webup.

Licence

WebUp is released at github.com/cariad/webup under the MIT Licence.

See 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.

Please consider supporting my open source projects by sponsoring me on GitHub.

Metadata

Release files for webup 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for webup 2.0.0
File Interpreter ABI Platform
webup-2.0.0-py3-none-any.whl Python 3 none any Details

Release files / webup-2.0.0-py3-none-any.whl

Download URL webup-2.0.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba4f3e30321c00dc6c98164971be1f67b30213d18684a0ed1ceeb2d6841d7db1
BLAKE2b-256 checksum
How to use checksums
c24f14d4b42acaff030fb6d98de11ce135516bbec007f7065f85f9362cacf928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page