A very simple python client used to update the IP address in A records for GoDaddy managed domains.
Project description
[](https://pypi.python.org/pypi/godaddypy) [](https://codeclimate.com/github/eXamadeus/godaddypy)
# GoDaddyPy
Python library useful for updating DNS settings through the GoDaddy v1 API.
Source: <https://github.com/eXamadeus/godaddypy>
Migrated from: <https://github.com/eXamadeus-zz/godaddypy>
Concept originated from observerss’ pygodaddy @ <https://github.com/observerss/pygodaddy>.
## Setup
First, go to <https://developer.godaddy.com/keys/> and request a production API key and secret.
Note: Sometimes the production API keys don’t seem to work correctly. Just delete it and request another one.
Second, install GoDaddyPy with pip.
` bash $ pip install godaddypy `
GoDaddyPy supports three methods for providing your credentials to the library, which are honored in the following order:
Passing them directly to the <span class=”title-ref”>Account</span> object
Setting the <span class=”title-ref”>GODADDY_API_KEY</span> and <span class=”title-ref”>GODADDY_API_SECRET</span> environment variables
Storing them in a credentials.yml file
For convenience, a configuration tool has been provided that can be run from your terminal or in Python. This tool will prompt for your API key and secret, and store them in a config file in your home directory following the XDG Base Directory specification. I have only tested this on Mac, but it should also work on Linux. I recommend env vars for Windows and/or CI/CD.
` bash $ python -m godaddypy `
` python >>> from godaddypy import Account >>> acct = Account.configure() Enter GoDaddy API Key [None]: example_key Enter GoDaddy API Secret [None]: example_secret >>> account = Account() >>> account._config Configuration(key='example_key', secret='example_secret') `
## Examples
Also see <span class=”title-ref”>/examples</span> for more examples.
` python >>> from godaddypy import Client, Account >>> >>> my_acct = Account(api_key='PUBLIC_KEY', api_secret='SECRET_KEY') >>> client = Client(my_acct) >>> >>> # Or if you want to use a delegate... >>> delegate_acct = Account(api_key='PUBLIC_KEY', api_secret='SECRET_KEY', delegate='DELEGATE_ID') >>> delegate_client = Client(delegate_acct) >>> >>> client.get_domains() ['domain1.example', 'domain2.example'] >>> >>> client.get_records('domain1.example', record_type='A') [{'name': 'dynamic', 'ttl': 3600, 'data': '1.1.1.1', 'type': 'A'}] >>> >>> client.update_ip('2.2.2.2', domains=['domain1.example']) True >>> >>> client.get_records('domain1.example') [{'name': 'dynamic', 'ttl': 3600, 'data': '2.2.2.2', 'type': 'A'}, {'name': 'dynamic', 'ttl': 3600, 'data': '::1', 'type': 'AAAA'},] >>> >>> client.get_records('apple.com', record_type='A', name='@') [{u'data': u'1.2.3.4', u'type': u'A', u'name': u'@', u'ttl': 3600}] >>> >>> client.update_record_ip('3.3.3.3', 'domain1.example', 'dynamic', 'A') True >>> >>> client.add_record('apple.com', {'data':'1.2.3.4','name':'test','ttl':3600, 'type':'A'}) True >>> >>> client.delete_records('apple.com', name='test') True `
## Contributing
If you want to contribute, first off: thank you! Second, please check out the Contributing Guidelines, [CONTRIBUTING](CONTRIBUTING).
### Steps to Contribute
Pull the repository
Run <span class=”title-ref”>make install</span> to install the library and development dependencies
Make changes
Add tests
Open a pull request towards the <span class=”title-ref”>main</span> branch
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file GoDaddyPy-2.5.0.tar.gz.
File metadata
- Download URL: GoDaddyPy-2.5.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7bbdbc891d12053757995a074032c9828fe753377f41eda7bfe4af393a5a3ff
|
|
| MD5 |
aaf8577d257d2491fd08e66d680ea3e9
|
|
| BLAKE2b-256 |
922cd0bf6d406f021fc06a64aa1eead10115b80e836922598d0c9a726c480ec3
|
File details
Details for the file GoDaddyPy-2.5.0-py2.py3-none-any.whl.
File metadata
- Download URL: GoDaddyPy-2.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7131c6584dca4d5d2bc60ebcc085070ee90fc87fd358e932b5818276029f760b
|
|
| MD5 |
664862c4eaa3c5e8512ddfa91f0350c6
|
|
| BLAKE2b-256 |
55d2f0f4c74be996c00d613a524a13133e9464b5044d22283deadfdb7d8f6b85
|