Skip to main content

Python SDK for the NS1 DNS platform

Project description

Build Status Docs

NS1 Python SDK

This project is in active development.

A Python SDK for accessing NS1, the Data Driven DNS platform.

About

This package provides a python SDK for accessing the NS1 DNS platform and includes both a simple NS1 REST API wrapper as well as a higher level interface for managing zones, records, data feeds, and more. It supports synchronous and asynchronous transports.

Python 3.8+ is supported. Automated tests are currently run against 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13

Installation

$ pip install ns1_python

Dependencies

None, but supports different transport backends. Currently supported:

  • requests (synchronous, the default if available)
  • urllib (synchronous, the default if requests isn't available)
  • twisted (asynchronous, requires 2.7 or 3.5+)

Other transports are easy to add, see transport

Examples

See the examples directory

Documentation

If you don't yet have an NS1 account, signup here (free)

You'll need an API Key. To create one, login to the portal and click on the Account button in the top right. Select Settings & Users, then add a new API Key at the bottom.

Tests

Unit tests use pytest (pip install pytest). 2.7 also requires mock to be installed (pip install mock).

Tests should, of course, run and pass under python 2 and 3. We use tox to automate test runs and virtualenv setup, see tox.ini for config.

Contributions

Pull Requests and issues are welcome. See the NS1 Contribution Guidelines for more information.

Editing the docs

You can create or edit NS1-python documentation by downloading the repo onto your machine and using an editor such as VSCode.

Creating Pull Requests

  1. When you're ready to submit your changes, add a descriptive title and comments to summarize the changes made.
  2. Select Create a new branch for this commit and start a pull request.
  3. Check the Propose file change button.
  4. Scroll down to compare changes with the original document.
  5. Select Create pull request.

Our CI process will lint and check for formatting issues with flake8 and black. It is suggested to run these checks prior to submitting a pull request and fix any issues:

pip install flake8 black
flake8 . --count --show-source --statistics --extend-ignore=E501
black . --check -l 79 --diff

NOTE

This package was originally named ns1-python, but to comply with PEP 625 it was renamed to ns1_python via this PR.

You can still install the ns1-python package as normal.

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

ns1_python-0.27.1.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ns1_python-0.27.1-py2.py3-none-any.whl (46.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ns1_python-0.27.1.tar.gz.

File metadata

  • Download URL: ns1_python-0.27.1.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ns1_python-0.27.1.tar.gz
Algorithm Hash digest
SHA256 601fb2e030d4487661680cbf54191a35dea7171e64db9994f97541f28ca1d08f
MD5 854a1ac62e522c364eff65e68fc429cd
BLAKE2b-256 3e54622f33fde673d7f0173b5a9eb7656eb24070b33075e7c12078190c1111cc

See more details on using hashes here.

File details

Details for the file ns1_python-0.27.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ns1_python-0.27.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ns1_python-0.27.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 34605c010b65b578f82ca356787698ac9a4c51d7fda93e39f4e2ee23f59dce6d
MD5 96f0a29c4001d67aa74fa3baaa0e236f
BLAKE2b-256 9bf23ead4bb9995b82c1aa318f547398d5f4891c93f19e703df1adc3495be20b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page