Skip to main content

Unofficial python package for domains.nethouse.ru service.

Project description

N3th0us3

N3th0us3 is unofficial python package for domains.nethouse.ru/domains service.

Description

Service domains.nethouse.ru/domains lets you check domain name across multiple top-level domains (citation: "checking the domain for occupancy, check whether the domain is occupied in all zones").

But this checking is sequential, one by one. Ohhh...

N3th0us3:

  • implements domain name checking function
  • lets to make it faster with multiprocess usage, not sequential
  • lets to make it at a time for multiple domains names
  • gives you interface for python

You can use N3th0us3 for print result data in console or saving it at file or database. Just realize this business logic at your callback function.

Install

$ pip install n3th0us3

Example

Native usage:

from n3th0us3 import pooled_domains_info

def your_callback_for_each_sub_request(data):
    print(data)
    
if __name__ == '__main__':
        
    pooled_domains_info(
        ['first-domain', 'second-domain',], 
        processes_count=16,
        callback_method=your_callback_for_each_sub_request
    )

or low-level usage of N3th0us3 in your script with command line usage:

python3 your_script.py first-domain second-domain third-domain -p 10 -tld ru su com
# file: your_script.py

import multiprocessing

from n3th0us3.domains import (
    TLD,
    formatted_print,
    get_domain_info
)

if __name__ == '__main__':
    from argparse import ArgumentParser

    parser = ArgumentParser()
    parser.add_argument("domain_name",
                        nargs='+',
                        help="space separated domains names list")
    parser.add_argument("-p", dest="processes_count", default=4,
                        type=int,
                        help="count of processes")
    parser.add_argument("-tld", dest="tld",
                        nargs='+', default=TLD,
                        help="space separated top-level domains")

    args = parser.parse_args()

    pool = multiprocessing.Pool(processes=args.processes_count)

    for domain_name in args.domain_name:
        for tld in args.tld:
            pool.apply_async(get_domain_info, args=(domain_name, tld), callback=formatted_print)

    pool.close()
    pool.join()

result is:

third-domain.su {'result': {'error': 'empty', 'domain': 'third-domain.su', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}
third-domain.com {'result': {'error': 'empty', 'domain': 'third-domain.com', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}
first-domain.com {'result': {'error': 'occupy', 'domain': 'first-domain.com', 'errrr': '', 'error_message': 'Домен занят', 'type_error': 'busy'}}
first-domain.su {'result': {'error': 'empty', 'domain': 'first-domain.su', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}
third-domain.ru {'result': {'error': 'empty', 'domain': 'third-domain.ru', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}
second-domain.com {'result': {'error': 'occupy', 'domain': 'second-domain.com', 'errrr': '', 'error_message': 'Домен занят', 'type_error': 'busy'}}
first-domain.ru {'result': {'error': 'empty', 'domain': 'first-domain.ru', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}
second-domain.ru {'result': {'error': 'empty', 'domain': 'second-domain.ru', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}
second-domain.su {'result': {'error': 'empty', 'domain': 'second-domain.su', 'errrr': '', 'is_premium_name': '', 'premium_price': ''}}

To be continue...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

n3th0us3-1.1.2.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file n3th0us3-1.1.2.tar.gz.

File metadata

  • Download URL: n3th0us3-1.1.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for n3th0us3-1.1.2.tar.gz
Algorithm Hash digest
SHA256 9856a2de434501804aefd8124956b4a6bcbdc9730725f7f3dc9e67edd5a2741a
MD5 a93e714006254a42e1ff5b14de9b7d64
BLAKE2b-256 e3888b8c54bafd19d7a15cb145409f5a381005b72d5ef0eaeb5ea7a14787cedb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page