Python client library for VinylDNS
Maintained. Last release 6 months ago, commits in 4 of the last 26 weeks. Weaker on commit activity.
pip install vinyldns-pythonvinyldns-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.