Skip to main content

k3awssign

Action-CI Documentation Status Package

A python lib is used for adding aws version 4 signature to request.

k3awssign is a component of pykit3 project: a python3 toolkit set.

This lib is used to sign a request using aws signature version 4. You need to provide a python dict which represent your request(it typically contains verb, uri, args, headers, body), and your access key and your secret key. This lib will add signature to the request.

Install

pip install k3awssign

Synopsis

import httplib

import k3awssign

access_key = "your access key"
secret_key = "your secret key"

signer = k3awssign.Signer(access_key, secret_key)

file_content = "bla bla"
request = {
    "verb": "PUT",
    "uri": "/test-bucket/test-key",
    "args": {
        "foo2": "bar2",
        "foo1": True,
        "foo3": ["bar3", True],
    },
    "headers": {
        "Host": "bscstorage.com",
        "Content-Length": len(file_content),
    },
    "body": file_content,
}

signer.add_auth(request, sign_payload=True)

conn = httplib.HTTPConnection("ss.bscstorage.com")
conn.request(request["verb"], request["uri"], request["body"], request["headers"])
resp = conn.getresponse()

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Metadata

Release files for k3awssign 0.1.6

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

Source distribution (sdist)

Source distribution for k3awssign 0.1.6
File Size Uploaded
k3awssign-0.1.6.tar.gz 16.2 kB Details

Built distribution (wheel)

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

Total release size: 25.7 kB

Release files / k3awssign-0.1.6.tar.gz

Download URL k3awssign-0.1.6.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bc95a892750e9eba9f948c903f493b1c9af9478532fec20e55a501371e40913b
BLAKE2b-256 checksum
How to use checksums
0e1f755bc09b0c6e3657842c260f18e8d10d385ca1b9449e682e40826b07a151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / k3awssign-0.1.6-py3-none-any.whl

Download URL k3awssign-0.1.6-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a6461a55bfa293533ef14d47e6ad66523c175ad81dd2e22d37eddf0f7d90c5e
BLAKE2b-256 checksum
How to use checksums
48c8cc1cdf36e51cbff1cb8531996e5ee3ffb2c63a7184a7586f321fa5919765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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