This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

UCloud authentication for the awesome requests!

How to Install

Just

pip install requests-ucloud

How to Use

Just pass the auth object to requests

Omni API Auth

For common api and ufile authentication

>>> import requests
>>> from ucloudauth import UCloudOmniAuth
>>> session = reqeusts.session()
>>> session.auth = UCloudOmniAuth("public-key", "private-key")
>>> session.get(
...     "http://api.ucloud.cn",
...     params=dict(Action="SomeAction")  # demo of common api
... )
<Response [200]>
>>> session.put(
...     "http://bucket.ufile.ucloud.cn/key",
...     data="test-data"  # demo of ufile api
... )
<Response [200]>

Common UCloud Auth

>>> import requests
>>> from ucloudauth import UCloudAuth
>>> requests.get(
...     "https://api.ucloud.cn/",
...     params=dict(SomeParams="SomeValue"),
...     auth=UCLoudAuth("public-key", "private-key")
... )
<Response [200]>

UFile Object Auth

>>> import requests
>>> from ucloudauth import UFile
>>> session = requests.session()
>>> session.auth = UFileAuth(
...     "public-key",
...     "private-key",
...     expires=None,  # for signing in url, expires is unix `timestamp`
...     expires_in=None,  # for signing in url, expires in `x` seconds
...     allow_empty_md5=False  # if no content-md5 was provided, UFileAuth will calculate for you
...     # set to `True` to disable this function
... )
>>> req = session.put(
...     "http://bucket-name.ufile.ucloud.cn/test-key.txt",
...     data="test-data"
... )
<Response [200]>
>>> url_auth = UFileAuth(
...     "public-key",
...     "private-key",
...     expires=None,  # for signing in url, expires is unix `timestamp`
...     expires_in=10,  # for signing in url, expires in 10 seconds
... )
>>> req = requests.Request(
...     "GET",  # http method
...     "http://bucket-name.ufile.ucloud.cn/test-key.txt",  # url
...     auth=url_auth
... )
>>> req.prepare().url
"http://bucket-name.ufile.cloud.cn/test-key.txt?Signature&Other&Params"

UCloud API

View full UCloud API

UFile API

View full UFile API

Release History

Release History

0.3.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
requests-ucloud-0.3.1.tar.gz (9.3 kB) Copy SHA256 Checksum SHA256 Source May 2, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting