PyGoDaddy is a 3rd-party client library, written in Python, for site admins(devs), to make GoDaddy suck less.
Currently, Only A-Record manipulation is supported
First, import and initiate GoDaddyClient
from pygodaddy import GoDaddyClient
client = GoDaddyClient()
Then we can use login method to login, and update_dns_record method to update dns record (A-Record Only)
if client.login(username, password):
client.update_dns_record('sub.example.com', '1.2.3.4')
A list of methods and be found in API Documents section below
GoDaddy Client Library
Typical Usage:
>>> from pygodaddy import GoDaddyClient
>>> client = GoDaddyClient()
>>> if client.login(username, password):
... client.update_dns_record('sub.example.com', '1.2.3.4')
delete hostname in accounts
Parameters: |
|
---|---|
Returns: | True if successful, else False |
find all dns reocrds of a given domain
Parameters: | domain – a typical domain name, e.g. “example.com” |
---|---|
Returns: | a dict of (hostname -> DNSRecord) |
Test login according to returned html, then set value to self.logged_in
Parameters: | html – the html content returned by self.session.get/post |
---|---|
Returns: | True if there’s welcome message, else False |
Login to a godaddy account
Parameters: |
|
---|---|
Returns: | True if login is successful, else False |
Update a dns record
Parameters: |
|
---|---|
Returns: | True if update is successful, else False |
This is a context manager for GoDaddyClient
Usage:
>>> from pygodaddy import GoDaddyAccount
>>> with GoDaddyAccount(username, password) as client:
... client.update_dns_record('sub1.exmaple.com', '1.2.3.4')
... client.update_dns_record('sub2.exmaple.com', '1.2.3.5')