# Python Client Library

## Installation

To install via [PyPI](https://pypi.org/project/tomba-io/):

```bash
pip install tomba-io
```

## Usage

### Domain Search

Get email addresses found on the internet.

```py
from tomba.client import Client
from tomba.services.domain import Domain

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

domain = Domain(client)

result = domain.domain_search('stripe.com')
```

### Email Finder

Find the verified email address of any professional.

```py
from tomba.client import Client
from tomba.services.finder import Finder

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

finder = Finder(client)

result = finder.email_finder('wordpress.org', 'Matt', 'Mullenweg')
```

### Email Verifier

Verify the validity of any professional email address with the most complete email checker.

```py
from tomba.client import Client
from tomba.services.verifier import Verifier

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

verifier = Verifier(client)

result = verifier.email_verifier('m@wordpress.org')
```

## Examples

### Get Account Information

```py
from tomba.client import Client
from tomba.services.account import Account

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

account = Account(client)

result = account.get_account()
```

### Email Count

```py
from tomba.client import Client
from tomba.services.count import Count

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

count = Count(client)

result = count.email_count('tomba.io')
```

### Enrichment Services

#### Combined Enrichment

```py
from tomba.client import Client
from tomba.services.enrichment import Enrichment

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

enrichment = Enrichment(client)

result = enrichment.combined('******@zapier.com')
```

#### Company Enrichment

```py
from tomba.client import Client
from tomba.services.enrichment import Enrichment

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

enrichment = Enrichment(client)

result = enrichment.company('zapier.com')
```

#### Person Enrichment

```py
from tomba.client import Client
from tomba.services.enrichment import Enrichment

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

enrichment = Enrichment(client)

result = enrichment.person('john.doe@zapier.com')
```

### Finder Services

#### Author Finder

```py
from tomba.client import Client
from tomba.services.finder import Finder

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

finder = Finder(client)

result = finder.author_finder('https://clearbit.com/blog/company-name-to-domain-api')
```

#### Email Enrichment

```py
from tomba.client import Client
from tomba.services.finder import Finder

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

finder = Finder(client)

result = finder.enrichment('b.mohamed@tomba.io')
```

#### LinkedIn Finder

```py
from tomba.client import Client
from tomba.services.finder import Finder

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

finder = Finder(client)

result = finder.linkedin_finder('https://www.linkedin.com/in/alex-maccaw-ab592978')
```

### API Key Management

#### Create API Key

```py
from tomba.client import Client
from tomba.services.keys import Keys

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

keys = Keys(client)

result = keys.create_key()
```

#### Delete API Key

```py
from tomba.client import Client
from tomba.services.keys import Keys

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

keys = Keys(client)

result = keys.delete_key('')
```

#### Get All API Keys

```py
from tomba.client import Client
from tomba.services.keys import Keys

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

keys = Keys(client)

result = keys.get_keys()
```

#### Reset API Key

```py
from tomba.client import Client
from tomba.services.keys import Keys

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

keys = Keys(client)

result = keys.reset_key('')
```

### Lead Attributes Management

#### Create Lead Attribute

```py
from tomba.client import Client
from tomba.services.leads_attributes import LeadsAttributes

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_attributes = LeadsAttributes(client)

result = leads_attributes.create_lead_attribute()
```

#### Delete Lead Attribute

```py
from tomba.client import Client
from tomba.services.leads_attributes import LeadsAttributes

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_attributes = LeadsAttributes(client)

result = leads_attributes.delete_lead_attribute('[Lead_Attributes_ID]')
```

#### Get Lead Attributes

```py
from tomba.client import Client
from tomba.services.leads_attributes import LeadsAttributes

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_attributes = LeadsAttributes(client)

result = leads_attributes.get_lead_attributes()
```

#### Update Lead Attribute

```py
from tomba.client import Client
from tomba.services.leads_attributes import LeadsAttributes

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_attributes = LeadsAttributes(client)

result = leads_attributes.update_lead_attribute('[Lead_Attributes_ID]')
```

### Lead Lists Management

#### Create Lead List

```py
from tomba.client import Client
from tomba.services.leads_lists import LeadsLists

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_lists = LeadsLists(client)

result = leads_lists.create_list()
```

#### Delete Lead List

```py
from tomba.client import Client
from tomba.services.leads_lists import LeadsLists

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_lists = LeadsLists(client)

result = leads_lists.delete_list_id('[LIST_ID]')
```

#### Get All Lead Lists

```py
from tomba.client import Client
from tomba.services.leads_lists import LeadsLists

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_lists = LeadsLists(client)

result = leads_lists.get_lists()
```

#### Update Lead List

```py
from tomba.client import Client
from tomba.services.leads_lists import LeadsLists

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

leads_lists = LeadsLists(client)

result = leads_lists.update_list_id('[List_ID]')
```

### Activity Logs

```py
from tomba.client import Client
from tomba.services.logs import Logs

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

logs = Logs(client)

result = logs.get_logs()
```

### Phone Services

#### Phone Finder

```py
from tomba.client import Client
from tomba.services.phone import Phone

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

phone = Phone(client)

result = phone.finder('******@zapier.com')
```

#### Phone Validator

```py
from tomba.client import Client
from tomba.services.phone import Phone

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

phone = Phone(client)

result = phone.validator('+14158586273')
```

### Similar Websites

```py
from tomba.client import Client
from tomba.services.similar import Similar

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

similar = Similar(client)

result = similar.websites('zapier.com')
```

### Email Sources

```py
from tomba.client import Client
from tomba.services.sources import Sources

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

sources = Sources(client)

result = sources.email_sources('b.mohamed@tomba.io')
```

### Domain and Company Status

#### Auto Complete

```py
from tomba.client import Client
from tomba.services.status import Status

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

status = Status(client)

result = status.auto_complete('google')
```

#### Domain Status

```py
from tomba.client import Client
from tomba.services.status import Status

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

status = Status(client)

result = status.domain_status('gmail.com')
```

### Technology Detection

```py
from tomba.client import Client
from tomba.services.technology import Technology

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

technology = Technology(client)

result = technology.list('zapier.com')
```

### Usage Statistics

```py
from tomba.client import Client
from tomba.services.usage import Usage

client = Client()

(client
  .set_key('ta_xxxx') # Your Key
  .set_secret('ts_xxxx') # Your Secret
)

usage = Usage(client)

result = usage.get_usage()
```

For more sample codes, check the [**examples/**](https://github.com/tomba-io/python/tree/master/examples) folder.
