Aliyun using python-requests
Version
v0.3.1
Aliyun authentication for the awesome requests!
[x] OSS (api-version: 2014-08-28)
[x] ECS (api-version: 2014-05-26)
[x] RDS (api-version: 2014-08-15)
[x] SLB (api-version: 2014-05-15)
[x] CMS (api-version: 2015-04-20)
How to Install
Just
pip install requests-aliyun
How to Use
Just pass the auth object to requests
>>> import requests
>>> from aliyunauth import OssAuth
>>> req = requests.get(
... "http://example.com/path/to/file",
... auth=OssAuth("bucket-name", "access-key", "secret-key")
... )
<Response [200]>
Or set the auth attribute to the session object
>>> import requests
>>> from aliyunauth import OssAuth
>>> session = requests.session()
>>> session.auth = OssAuth("bucket-name", "access-key", "secret-key")
>>> req = session.get("http://example.com/path/to/file")
<Response [200]>
Play with OSS
Full api document avaiable at: OSS API
>>> import requests
>>> from aliyunauth import OssAuth
>>> req = requests.get(
... "http://bucket-name.oss-url.com/path/to/file",
... auth=OssAuth("bucket-name", "access-key", "secret-key")
... )
<Response [200]>
Play with ECS
Full api document avaiable at: ECS API
>>> import requests
>>> from aliyunauth import EcsAuth
>>> req = requests.get(
... "https://ecs.aliyuncs.com",
... params=dict(Action="DescribeInstanceTypes"),
... auth=EcsAuth("access-key", "secret-key")
... )
<Response [200]>
Play with RDS
Full api document avaiable at: RDS API
>>> import requests
>>> from aliyunauth import RdsAuth
>>> req = requests.get(
... "https://rds.aliyuncs.com",
... params=dict(Action="DescribeDBInstances", RegionId="cn-hangzhou"),
... auth=RdsAuth("access-key", "secret-key")
... )
<Response [200]>
Play with SLB
Full api document avaiable at: SLB API
Play with CMS
Full api document avaiable at: CMS API
>>> import requests
>>> from aliyunauth import CmsAuth
>>> req = requests.get(
... "metrics.aliyuncs.com",
... params=dict(Action="DescribeMetricDatum"),
... auth=CmsAuth("access-key", "secret-key")
... )
<Response [200]>
Metadata
Release files for requests-aliyun 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| requests-aliyun-0.3.1.tar.gz | 12.8 kB | Without provenance | Details |
Release files / requests-aliyun-0.3.1.tar.gz
| Download URL | requests-aliyun-0.3.1.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1f34ffb3cfc0ab2fcec4d86367c318ac2ffa2a7fbfb0df8103ad8fbbd6abe7a
|
|
BLAKE2b-256 checksum How to use checksums |
873a12725b6bb33751370e8a3dbffe61474a03c32dd1cebc01df5f176f33b016
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for requests-aliyun 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.