Skip to main content

Hunter.io v2 api implementation

Project description

Forager clients and services

A python wrapper for the Hunter.io v2 api as a client. Email validation service.

Installation

Requirements

- Python 3.10
- httpx

To install

pip install forager_forward==0.1.0

Usage

Service supports next method from Hunter.io v2 api

- domain_search (with async adomain_search)
- email_finder (with async aemail_finder)
- verify_email (with async averify_email)
- email_count (with async aemail_count)

Additionally, service supports crud methods for locally storing data

How to use service

Import service and instantiate it once

from forager_forward.client_initializer import ClientInitializer

initializer = ClientInitializer()

initializer.initialize_client("api_key_got_from_hunter")

initializer.initialize_async_client("api_key_got_from_hunter")

client = initializer.client

async_client = initializer.async_client

Once initialized somewhere in the code you can get instances in different places without additional initialization

client = ClientInitializer().client

async_client = ClientInitializer().async_client

Search addresses for a given domain

client.domain_search("www.brillion.com.ua")

Or pass company name

client.domain_search(company="Brillion", limit=20, seniority="junior")

Find email address

client.email_finder(compayny="pmr", full_name="Sergiy Petrov", raw=True)

Check email deliverabelity

client.email_verifier("a@a.com")

All data can be stored in Storage class instance. It has its own crud methods, and it is Singleton.

from forager_forward.common.storage import Storage

storage = Storage()

storage.create(some_key, some_value)

storage.update(some_key, some_value)

some_variable = storage.read(some_key)

storage.delete(some_key)

To validate emails and store validation result use email_validation_service.

from forager_forward.app_services.email_validation_service import EmailValidationService

email_validator = EmailValidationService()

email_validator.create_email_record("some_email@company.com")

email_validator.read("another@company.com")

Tests

To run test firstly you need to install test dependency, then run

    pytest -cov

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

forager_forward-0.1.0.tar.gz (15.9 kB view hashes)

Uploaded Source

Built Distribution

forager_forward-0.1.0-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

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