Skip to main content

make simple dnsmadeeasy api calls

Project description

Dnsmeapi Python client

simplify dnsmadeeasy api calls :- Python 3.7


From the project root directory

export PYTHONPATH=$(pwd)
pytest .

Dnsmeapi Class

class Dnsmeapi:
    hmac = None
    request_date = None
    api_key = ""
    api_secret_key = ""

    def __init__(self, api_key, api_secret_key):
        self.api_key = api_key
        self.api_secret_key = api_secret_key

    def make_request(self, method_type, url, payload):
        self.request_date = formatdate(timeval=None, localtime=False, usegmt=True)
            self.hmac =
                bytes(self.api_secret_key, "UTF-8"),
                bytes(self.request_date, "UTF-8"),
        except Exception as e:
            raise e

        headers = {
            "Content-Type": "application/json",
            "x-dnsme-hmac": self.hmac,
            "x-dnsme-apiKey": self.api_key,
            "x-dnsme-requestDate": self.request_date,

            response = requests.request(method_type, url, headers=headers, data=payload)
            return response.text.encode('utf-8')
        except Exception as e:
            raise e


from dnsmeapi import Dnsmeapi

Initalise class

dnsmeapi = Dnsmeapi( "api_key", "api_secret_key" )

Send Request

dnsmeapi.make_request( "GET", "URL", {} )

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

dnsmeapi-0.0.2.tar.gz (2.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page