Code Monkey home page Code Monkey logo

vinyldns-python's Introduction

PyPI version Travis build

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")

vinyldns-python's People

Contributors

amanda-e-giles avatar britneywright avatar kristakhare avatar lekum avatar nimaeskandary avatar pauljamescleary avatar rebstar6 avatar rodxavier avatar shirlazybrat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.