This topic describes how to install and use the RAM SDK for Python.
Install the RAM SDK for Python
Run the pip command, or download the SDK packages and then add them to your project.
- Run the following command:
pip install aliyun-python-sdk-ram.
- Download the SDK packages from the following links and then add the packages to your project:
Use the RAM SDK for Python
The following sample code uses the RAM SDK for Python to create a RAM user.
#! /usr/bin/env python #coding=utf-8 from aliyunsdkcore import client from aliyunsdkram.request.v20150501 import CreateUserRequest # Construct an Alibaba Cloud client, and set the AccessKey ID and AccessKey secret. The client will be used to send a request. clt = client.AcsClient('<access-key-id>','<access-key-secret>') # Construct a CreateUser request. request = CreateUserRequest.CreateUserRequest() # Specify the UserName parameter. request.set_UserName('alice') # Issue the request and obtain a response. response = clt.do_action_with_exception(request) print response