Skip to main content

Python client library for VinylDNS

Project description

PyPI version Travis build GitHub

vinyldns-python

Python client library for VinylDNS

This project is a work in progress! If you would like to help us get this where it needs to be, please reach out to us in gitter.

To run, pip install vinyldns-python and then:

>>> from vinyldns.client import VinylDNSClient
>>> local_client = VinylDNSClient("ApiEndpoint", "UserAccessKey", "UserSecretKey")
>>> local_client.list_zones()
>>>
>>> # If all of the following environments are set
>>> # - VINYLDNS_API_URL
>>> # - VINYLDNS_ACCESS_KEY_ID
>>> # - VINYLDNS_SECRET_ACCESS_KEY
>>> from vinyldns.client import VinylDNSClient
>>> local_client = VinylDNSClient.from_env()
>>> local_client.list_zones()

Contributing

Requirements

  • python3
  • pip
  • virtualenv

To get started, you will want to setup your virtual environment.

  1. Ensure that you have virtualenv installed > pip install virtualenv
  2. Run ./bootstrap.sh to setup your environment (unless you really want all these dependencies to be installed locally, which we do not recommend).
  3. Activate your virtual environment > source .virtualenv/bin/activate and you will be ready to go!

Unit Tests

Unit tests are developed using pytest. We use Responses, which allows for simple mocking of HTTP endpoints.

To run unit tests, you can simply run python3 setup.py test. To target a specific test, you can run python3 setup.py test -a "-k my_test"

Functional Tests

Functional tests are also developed with pytest. These tests run against a local instance of VinylDNS. Note that for now they are not tied into our travis build, so they must be run locally for validation.

From your virtualenv, run tox -e func_test

Running a full build

When you are finished writing your code you will want to run everything including linters. The simplest way to do this is to run tox -e check,py36, which will run static checks and run unit tests.

If you see any failures / warnings, correct them until tox runs successfully.

If you do not have tox in your environment, pip install tox to add it. For more information you can read the tox docs.

Local Development

See the quickstart in the VinylDNS api for details on how to start up a local instance of the api in docker. With that running, you can make requests with the following client details:

local_client = VinylDNSClient("http://localhost:9000", "okAccessKey", "okSecretKey")

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

vinyldns_python-0.9.9.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

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

vinyldns_python-0.9.9-py2.py3-none-any.whl (24.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file vinyldns_python-0.9.9.tar.gz.

File metadata

  • Download URL: vinyldns_python-0.9.9.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.7

File hashes

Hashes for vinyldns_python-0.9.9.tar.gz
Algorithm Hash digest
SHA256 6e59690a3fae281c147d99f9747143cc3dfe06f8d58d2826b719adff7ddafc8b
MD5 eb2fce809600071c6015d0e2786c64e4
BLAKE2b-256 847627e4e202f878fe5168cb05f848715ff53a78da7a7c1bb7b1ade0a31f6630

See more details on using hashes here.

File details

Details for the file vinyldns_python-0.9.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for vinyldns_python-0.9.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 34c1ea76d77a7bcba8ff9606a996ebf4704633cc7230987d9c40fd6b29b4cde3
MD5 003c4cfab503868d8dbbe86fb7f41733
BLAKE2b-256 23ddc6a025ec3c79ae81cef3e5d06cf59621b13a0d459e16ec5220abbda7cb6a

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