Skip to main content

Version

v0.3.1

https://travis-ci.org/SkyLothar/requests-aliyun.svg?branch=master https://coveralls.io/repos/SkyLothar/requests-aliyun/badge.png https://requires.io/github/SkyLothar/requests-aliyun/requirements.svg?branch=master Supported Python versions License

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]>

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests-aliyun-0.3.1.tar.gz (12.8 kB view details)

Uploaded Source

File details

Details for the file requests-aliyun-0.3.1.tar.gz.

File metadata

File hashes

Hashes for requests-aliyun-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d1f34ffb3cfc0ab2fcec4d86367c318ac2ffa2a7fbfb0df8103ad8fbbd6abe7a
MD5 65988caad09732270475aca024bb183e
BLAKE2b-256 873a12725b6bb33751370e8a3dbffe61474a03c32dd1cebc01df5f176f33b016

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 file

0.3.0

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.2

1 file

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