Skip to content

Update to API v2 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# email_hunter_python
### An Email Hunter API client written in Python
# hunter_python
### A Hunter API client written in Python

## Installation
Requirements:
Expand All @@ -9,85 +9,91 @@ Requirements:

To install:
```
pip install email-hunter-python
pip install hunter-python
```

To update:
```
pip install --upgrade email-hunter-python
pip install --upgrade hunter-python
```

## Usage

email_hunter_python supports the three main methods of the [Email Hunter](https://emailhunter.co/api/docs) API:
`search`, `generate`, and `exist`. There are two ways to use email_hunter_python:
hunter_python supports the three main methods of the [Hunter](https://hunter.io/api/docs) API:
`search`, `find` and `verify`. There are two ways to use hunter_python:

* As a Python library
* As a command line (CLI) tool.

#### To use the email_hunter_python Python library:
#### To use the hunter_python Python library:

Import the client and instantiate it:
```python
from email_hunter import EmailHunterClient
from hunter import HunterClient
```
```
client = EmailHunterClient('my_api_key')
client = HunterClient('my_api_key')
```

You can search:
```python
client.search('google.com')
```

A max of 100 results are returned, so use offset to paginate:
By default 10 results are returned, so use offset to paginate:
```python
client.search('google.com', offset=1)
client.search('google.com', offset=10)
```

You can also limit the number of results:
```python
client.search('google.com', limit=5)
```

You can also change type (personal or generic):
```python
client.search('google.com', type_='personal')
```

You can generate:
You can find an email:
```python
client.generate('google.com', 'Sergey', 'Brin')
client.find('google.com', 'Sergey', 'Brin')
```

And you can check if an email exists:
And you can verify the deliverability of an email address:
```python
client.exist('[email protected]')
client.verify('[email protected]')
```

#### To use email_hunter_python as a CLI tool:
#### To use hunter_python as a CLI tool:

```
email_hunter [command name] [api_key] [other args]
hunter [command name] [api_key] [other args]
```

The command name is `search`, `generate` or `exist`, the api_key is the API key associated with your Email Hunter
The command name is `search`, `find` or `verify`, the api_key is the API key associated with your Hunter
account

The other arguments depend on the command you are using:
```
--domain Required for search and generate commands
--offset Optional, used with search command.
--domain Required for search and find commands
--limit Optional, used with search command
--offset Optional, used with search command
--type Optional, used with search command
--first_name Required for generate command
--last_name Required for generate command
--email Required for exist command
--first_name Required for find command
--last_name Required for find command
--email Required for verify command
--file Path to a CSV to be used with the specified command.
CSV must have a column for each argument used.
```

The file argument is useful when you want to make several requests of the same type. For example if you wanted to find
the email addresses for several people at an organization you would do the following:
```
email_hunter generate [api_key] --file people.csv > emails.csv
hunter find [api_key] --file people.csv > emails.csv
```
Where `people.csv` looks like:

Where `people.csv` looks like:
```
domain,first_name,last_name
google.com,larry,page
Expand Down
9 changes: 0 additions & 9 deletions email_hunter/__init__.py

This file was deleted.

71 changes: 0 additions & 71 deletions email_hunter/email_hunter_client.py

This file was deleted.

9 changes: 9 additions & 0 deletions hunter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2015 Alan Vezina. All rights reserved.
from .hunter_client import HunterClient
import hunter.cli as cli

__title = 'Hunter'
__author__ = 'Alan Vezina'
__version__ = '2.0.0'
__license__ = 'MIT'
__all__ = ['HunterClient', 'cli']
Loading