Higher level Python interface to the OpenSRS XML API
Project description
OpenSRS-py
Version 0.1.3
=============
This is a python implementation of the [OpenSRS][opensrs] [XML API][xmlapi].
It is only a light wrapper around the structure of the requests and
responses as defined by the API.
Example Usage
-------------
Here is what a post call looks like:
from opensrs import OpenSRS
opensrs = OpenSRS("myusername", "privatekey", test=True)
opensrs.post("sw_register", "domain",
attrs={
"domain": "example.com",
"auto_renew": 1,
"link_domains": 0,
"reg_type": "new",
"contact_set": {
"owner": { ... },
"admin": { ... },
"billing": { ... },
"tech": { ... },
},
"nameserver_list": [
{
"sortorder": 1,
"name": "ns1.fatbox.ca",
},
{
"sortorder": 2,
"name": "ns2.fatbox.ca",
},
],
},
extra_items = {
"registrant_ip": "1.2.3.4",
},
)
And you get back a data structure like:
{
"protocol": "XCP",
"action": "reply",
"response_code": "200",
"is_success": 1,
"attributes": {
...
},
}
Requirements
------------
* xml.etree.ElementTree
* httplib2
[opensrs]: http://opensrs.com
[xmlapi]: http://opensrs.com/docs/opensrsapixml/index.htm
Version 0.1.3
=============
This is a python implementation of the [OpenSRS][opensrs] [XML API][xmlapi].
It is only a light wrapper around the structure of the requests and
responses as defined by the API.
Example Usage
-------------
Here is what a post call looks like:
from opensrs import OpenSRS
opensrs = OpenSRS("myusername", "privatekey", test=True)
opensrs.post("sw_register", "domain",
attrs={
"domain": "example.com",
"auto_renew": 1,
"link_domains": 0,
"reg_type": "new",
"contact_set": {
"owner": { ... },
"admin": { ... },
"billing": { ... },
"tech": { ... },
},
"nameserver_list": [
{
"sortorder": 1,
"name": "ns1.fatbox.ca",
},
{
"sortorder": 2,
"name": "ns2.fatbox.ca",
},
],
},
extra_items = {
"registrant_ip": "1.2.3.4",
},
)
And you get back a data structure like:
{
"protocol": "XCP",
"action": "reply",
"response_code": "200",
"is_success": 1,
"attributes": {
...
},
}
Requirements
------------
* xml.etree.ElementTree
* httplib2
[opensrs]: http://opensrs.com
[xmlapi]: http://opensrs.com/docs/opensrsapixml/index.htm
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
OpenSRS-0.1.3.tar.gz
(5.7 kB
view details)
File details
Details for the file OpenSRS-0.1.3.tar.gz
.
File metadata
- Download URL: OpenSRS-0.1.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70ece4d2d843b7596a00f0e58f1b2ed92872d5b16092a79307fb4b3af162a648 |
|
MD5 | 222bc947942d1c95dd475d90dd77f52b |
|
BLAKE2b-256 | 35b6e97c978b5fec5cafa754e7d8840df6cadf516fa0217ec3ca8a685a0c4d3e |