Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.
/ py-tlds Public archive

A Python util that retrieves and validates a list of top-level domains from the Internet Assigned Names Authority

License

Notifications You must be signed in to change notification settings

critical-path/py-tlds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status

py-tlds v1.0.0

py-tlds is a util that retrieves and validates a list of top-level domains (TLDs) from the Internet Assigned Names Authority.

Dependencies

py-tlds requires Python 3.x and the pip package. It also requires the following packages for usage and testing.

Usage:

  • click
  • requests

Testing:

  • coveralls
  • flake8
  • pytest
  • pytest-cov
  • radon
  • responses

Installing py-tlds with test cases and testing dependencies

  1. Clone or download this repository.

  2. Using sudo, run pip with the install command and the --editable option.

sudo pip install --editable .[test]

Installing py-tlds without test cases or testing dependencies

  1. Clone or download this repository.

  2. Using sudo, run pip with the install command.

sudo pip install .

Using py-tlds from the command line

To retrieve and validate a list of TLDs, simply run tlds.

tlds

To write the results to disk, run tlds with either the --write or the -w option.

tlds --write
tld -w

Using py-tlds from within Python

  1. Import TopLevelDomainGetter and write_results.
  2. Instantiate TopLevelDomainGetter and call its get method.
  3. Call the write_results function.
from tlds import (
  TopLevelDomainGetter,
  write_results
)

tld_getter = TopLevelDomainGetter()
tlds = tld_getter.get()
write_results(tlds)

Testing py-tlds after installation

  1. Run radon with the mi command and the --show option.
radon mi --show tlds
  1. Run flake8 with the --count option.
flake8 --count tlds
  1. Run pytest with with -vv, --cov, and cov-report options.
pytest -vv --cov --cov-report=term-missing

About

A Python util that retrieves and validates a list of top-level domains from the Internet Assigned Names Authority

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages