All Projects → dnsimple → dnsimple-python

dnsimple / dnsimple-python

Licence: MIT license
The DNSimple API client for Python.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to dnsimple-python

strillone
Listen to incoming webhooks from DNSimple, and publish them to a Slack channel or other messaging service.
Stars: ✭ 21 (-68.18%)
Mutual labels:  dnsimple, dnsimple-api, dnsimple-policy-dev, dnsimple-policy-dev-active
chef-dnsimple
Chef cookbook for DNSimple.
Stars: ✭ 37 (-43.94%)
Mutual labels:  dnsimple, dnsimple-api, dnsimple-policy-dev
terraform-provider-dnsimple
Terraform DNSimple provider
Stars: ✭ 15 (-77.27%)
Mutual labels:  dnsimple, dnsimple-policy-dev, dnsimple-policy-dev-active
dnsimple-elixir
The DNSimple API client for Elixir.
Stars: ✭ 49 (-25.76%)
Mutual labels:  dnsimple, dnsimple-api, dnsimple-policy-dev
dnsimple-api-examples
Example scripts and code to demonstrate how to use the DNSimple API
Stars: ✭ 22 (-66.67%)
Mutual labels:  dnsimple-policy-dev, dnsimple-policy-dev-active
chef-pdns
Development repository for DNSimple Cookbook PowerDNS.
Stars: ✭ 22 (-66.67%)
Mutual labels:  dnsimple-policy-dev, dnsimple-policy-dev-active
pinboard.net
Fully featured API wrapper for pinboard.in
Stars: ✭ 21 (-68.18%)
Mutual labels:  api-client
my api client
A framework of Web API Client. Provides features error handling, retrying, pagination and so on.
Stars: ✭ 19 (-71.21%)
Mutual labels:  api-client
yelp-ios
No description or website provided.
Stars: ✭ 61 (-7.58%)
Mutual labels:  api-client
sia-cog
Various cognitive api for machine learning, vision, language intent alalysis. Covers traditional as well as deep learning model design and training.
Stars: ✭ 34 (-48.48%)
Mutual labels:  api-client
v-shopware-api-client
The reliable way to import and update a bazillion products.
Stars: ✭ 20 (-69.7%)
Mutual labels:  api-client
Clamor
The Python Discord API Framework
Stars: ✭ 14 (-78.79%)
Mutual labels:  api-client
nis-python-client
Python client for NEM NIS API (https://nemproject.github.io). XEM\NEM\Crypto
Stars: ✭ 16 (-75.76%)
Mutual labels:  api-client
strava
PHP Class for the Strava API (v3)
Stars: ✭ 117 (+77.27%)
Mutual labels:  api-client
bitflyer-api-dotnet-client
bitFlyer HTTP APIs Client Library for .NET (C#)
Stars: ✭ 23 (-65.15%)
Mutual labels:  api-client
php-abraflexi
PHP Based Library for easy interaction with czech accounting system FlexiBee.
Stars: ✭ 15 (-77.27%)
Mutual labels:  api-client
ssc-restapi-client
Communicate with Fortify Software Security Center through REST API in java, a swagger generated client
Stars: ✭ 13 (-80.3%)
Mutual labels:  api-client
WikidataR
An R package for the Wikidata API
Stars: ✭ 49 (-25.76%)
Mutual labels:  api-client
tempo-api-python-client
Python bindings for Tempo - https://apidocs.tempo.io/
Stars: ✭ 17 (-74.24%)
Mutual labels:  api-client
jacky
🐄 HTTP JSON API Client for Laravel & Lumen
Stars: ✭ 17 (-74.24%)
Mutual labels:  api-client

DNSimple Python Client

A Python client for the DNSimple API v2.

CI

Documentation

Requirements

  • Python 3.6+ (PyPy supported) - Note later versions of Python may be supported, but we make no guarantees as they are not tracked in our CI.

Installation

Where <version> denotes the version of the client you want to install.

To install the latest version:

pip install dnsimple

To install a specific version:

pip install dnsimple==2.0.1

Usage

This library is a Python client you can use to interact with the DNSimple API v2. Here are some examples.

from dnsimple import Client

client = Client(access_token='a1b2c3')

# Fetch your details
response = client.identity.whoami()             # execute the call
data = response.data                            # extract the relevant data from the response or
account = client.identity.whoami().data.account # execute the call and get the data in one line

Sandbox Environment

We highly recommend testing against our sandbox environment before using our production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the chance of your running up against rate limits.

The client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using the base_url option when you construct the client:

from dnsimple import Client

client = Client(base_url='https://api.sandbox.dnsimple.com', access_token="a1b2c3")

You can also set the sandbox environment like so:

from dnsimple import Client

client = Client(sandbox=True, access_token='a1b2c3')

You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will not work in the sandbox environment.

Define an account ID

from dnsimple import Client

client = Client(access_token='a1b2c3')
account_id = 1010

# You can also fetch it from the whoami response
# as long as you authenticate with an Account access token
whoami = client.identity.whoami().data
account_id = whoami.account.id

List your domains

from dnsimple import Client

client = Client(access_token='a1b2c3')

account_id = client.identity.whoami().data.account.id
domains = client.domains.list_domains(account_id).data                           # Domains from the 1010 account (first page)
client.domains.list_domains(account_id, sort='expires_on:asc').data              # Domains from the 1010 account in ascending order by domain expiration date
client.domains.list_domains(account_id, filter={'name_like': 'example'}).data    # Domains from the 1010 account filtered by the domain name name

Create a domain

from dnsimple import Client

client = Client(access_token='a1b2c3')

account_id = client.identity.whoami().data.account.id
response = client.domains.create_domain(account_id, 'example.com')
domain = response.data # The newly created domain

Get a domain

from dnsimple import Client

client = Client(access_token='a1b2c3')

account_id = client.identity.whoami().data.account.id
domain_id = client.domains.list_domains(account_id).data[0].id
domain = client.domains.get_domain(account_id, domain_id).data # The domain you are looking for

Setting a custom User-Agent header

You customize the User-Agent header for the calls made to the DNSimple API:

from dnsimple import Client

client = Client(user_agent="my-app")

The value you provide will be appended to the default User-Agent the client uses. For example, if you use my-app, the final header value will be my-app dnsimple-python/0.1.0 (note that it will vary depending on the client version).

## Contributing

Contibutions are welcomed. Please open an issue to discuss the changes before opening a PR. For more details on how to do development please refer to CONTRIBUTING.md

License

Copyright (c) 2022 DNSimple Corporation. This is Free Software distributed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].