Python client library for VinylDNS
Project description
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
python3pipvirtualenv
To get started, you will want to setup your virtual environment.
- Ensure that you have
virtualenvinstalled> pip install virtualenv - Run
./bootstrap.shto setup your environment (unless you really want all these dependencies to be installed locally, which we do not recommend). - Activate your virtual environment
> source .virtualenv/bin/activateand 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vinyldns_python-0.9.8.tar.gz.
File metadata
- Download URL: vinyldns_python-0.9.8.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c9dd350e9bcf43ae08a2b6f09e70d5035c92352dca28d9659e3062f9c19307a
|
|
| MD5 |
54f83855a67aa9b638ad8a17e70d619d
|
|
| BLAKE2b-256 |
5ddf96f266d3dbe5052efe6680423da559e11db41de197731a3ad2e1d5263d0b
|
File details
Details for the file vinyldns_python-0.9.8-py2.py3-none-any.whl.
File metadata
- Download URL: vinyldns_python-0.9.8-py2.py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
766f555e6ce071b0248b1a77517b16ef23eada1fb1c4f941aaa6411b7f78a0a6
|
|
| MD5 |
1fa3a10e112ede1f13b15b542fb2ff16
|
|
| BLAKE2b-256 |
265a2976f214613985dde0a505a97d9980379a7272cd8dba661211a356367c5d
|