coverage Tests wemake-python-styleguide wblack Dependabot Status

DNS INFO RESEARCHER

Helper for getting DNS records. All methods are cached.

Demo:

Table of Contents

Installation

Create .env file in project root and set environment variables for application (example: .env.example).

Without docker

Install requirements:

  • Local verision: pip install -r requirements/local.txt
  • Production version: pip install -r requirements/production.txt

Run the web application:

uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

With docker

You must have docker and docker-compose tools installed to work with material in this section.

  • Local version: docker-compose -f docker-compose-local.yml up -d --build
  • Production version: docker-compose -f docker-compose-production.yml up -d --build

Kubernetes

Use kubernetes.yaml and autoscale.yaml

Usage

URL

The application will be available on localhost in your browser.

Docs

All routes are available on /docs or /redoc paths with Swagger or ReDoc.

http://127.0.0.1:8000/docs

http://127.0.0.1:8000/redoc

Project structure

Files related to application are in the app or tests directories. Application parts are:

app
├── api              - web related stuff.
│   └── endpoints    - web routes.
├── core             - application configuration, startup events, logging, caching.
├── models           - pydantic models for this application.
│   └── schemas      - schemas for using in web routes.
├── services         - business logic.
└── main.py          - FastAPI application creation and configuration.
tests                - tests

pre-commit

Content: .pre-commit-config.yaml

pre-commit run --all-files
pre-commit install

TODO

  • Add different responses for exceptions (resolver.NoAnswer, resolver.NXDOMAIN)
  • Add other types of records

CI

Look at directories: scripts, .github.