Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Python client for the DNSimple API v2.
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
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
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.
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
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
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
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
User-Agent
headerYou 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).
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
Copyright (c) 2024 DNSimple Corporation. This is Free Software distributed under the MIT license.
FAQs
DNSimple API service for python
We found that dnsimple demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.