---
title: "openemail.tools"
description: "Every method in this namespace: its signature, its parameters, what it returns and an example."
url: "https://openemail.uk/docs/python/reference/tools"
area: "Python"
category: "Reference"
---

# openemail.tools

Every method in this namespace: its signature, its parameters, what it returns and an example.

## Methods

Checks of the public mail records of any domain, the free tools on the OpenEmail website: its DMARC policy, its BIMI logo and a deliverability report across MX, SPF, DKIM, DMARC and BIMI. They need no scope.

### `tools.check_dmarc()`

Check a domain's DMARC policy

```python
def check_dmarc(
    domain: str,
    *,
    api_key: str | None = None,
    timeout: float | None = None,
) -> DmarcReportResource
```

Reads the domain's DMARC record from public DNS, or the record of the organisational domain it inherits from, and says how strict it is and what is wrong with it, the DMARC checker on the OpenEmail website. `stage` is `missing`, `invalid`, `monitor` for `p=none`, `quarantine` or `reject`, and `issues` lists the problems written to be shown to a person.

**Parameters**

- `domain` (`str`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `api_key` (`str`): Overrides the client's API key for this call only.
- `timeout` (`float`): Seconds this call may take, the response included, before it raises `OpenEmailNetworkError` with `is_timeout`. It overrides the client's `timeout` for this call, and `0` turns the limit off.

**Returns**

`DmarcReportResource` with `domain`, `record`, `inheritedFrom`, every tag in `tags`, `stage` and `issues`.

**Example**

```python
from openemail import openemail

report = openemail.tools.check_dmarc('acme.com')

print(report['stage'], report['tags'].get('p'), report['issues'])
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.

Also available in: API [`GET /tools/dmarc`](https://openemail.uk/docs/api/reference/tools#get-tools-dmarc); TypeScript [`tools.checkDmarc()`](https://openemail.uk/docs/sdk/reference/tools#checkDmarc); Ruby [`tools.check_dmarc`](https://openemail.uk/docs/ruby/reference/tools#checkDmarc); CLI [`openemail tools check-dmarc`](https://openemail.uk/docs/cli/reference/tools#tools-check-dmarc).

### `tools.check_bimi()`

Check a domain's BIMI logo

```python
def check_bimi(
    domain: str,
    *,
    api_key: str | None = None,
    timeout: float | None = None,
) -> BimiReportResource
```

Reads the domain's BIMI record, fetches the logo it names and checks the DMARC policy beside it, since inboxes draw a logo only at `p=quarantine` or `p=reject`, the BIMI checker on the OpenEmail website. `status` is `present`, `partial` when the record is there but something stops inboxes showing the logo, `absent` or `invalid`, and `issues` says why.

**Parameters**

- `domain` (`str`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `api_key` (`str`): Overrides the client's API key for this call only.
- `timeout` (`float`): Seconds this call may take, the response included, before it raises `OpenEmailNetworkError` with `is_timeout`. It overrides the client's `timeout` for this call, and `0` turns the limit off.

**Returns**

`BimiReportResource` with `record`, `logoUrl`, `authorityUrl`, `logoSvg`, `logoReachable`, `dmarcPolicy`, `dmarcEnforced`, `status` and `issues`.

**Example**

```python
from openemail import openemail

report = openemail.tools.check_bimi('acme.com')

if report['status'] != 'present':
    for issue in report['issues']:
        print(issue)
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.

Also available in: API [`GET /tools/bimi`](https://openemail.uk/docs/api/reference/tools#get-tools-bimi); TypeScript [`tools.checkBimi()`](https://openemail.uk/docs/sdk/reference/tools#checkBimi); Ruby [`tools.check_bimi`](https://openemail.uk/docs/ruby/reference/tools#checkBimi); CLI [`openemail tools check-bimi`](https://openemail.uk/docs/cli/reference/tools#tools-check-bimi).

### `tools.check_deliverability()`

Check a domain's deliverability

```python
def check_deliverability(
    domain: str,
    *,
    api_key: str | None = None,
    timeout: float | None = None,
) -> DeliverabilityReportResource
```

Checks the records a receiving mailbox reads before it trusts mail from the domain, the deliverability checker on the OpenEmail website: MX, SPF, DKIM at the selectors its mail provider uses, DMARC and BIMI. Each check says `pass`, `warn`, `fail` or `absent` with a verdict and notes, and `score` weighs them into 0 to 100, graded `A` to `F`.

**Parameters**

- `domain` (`str`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `api_key` (`str`): Overrides the client's API key for this call only.
- `timeout` (`float`): Seconds this call may take, the response included, before it raises `OpenEmailNetworkError` with `is_timeout`. It overrides the client's `timeout` for this call, and `0` turns the limit off.

**Returns**

`DeliverabilityReportResource` with `score`, `grade`, `provider` and `checks`, each with `id`, `label`, `status`, `verdict`, `record` and `notes`.

**Example**

```python
from openemail import openemail

report = openemail.tools.check_deliverability('acme.com')

print(report['grade'], report['score'])

for check in report['checks']:
    print(check['id'], check['status'], check['verdict'])
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.

Also available in: API [`GET /tools/deliverability`](https://openemail.uk/docs/api/reference/tools#get-tools-deliverability); TypeScript [`tools.checkDeliverability()`](https://openemail.uk/docs/sdk/reference/tools#checkDeliverability); Ruby [`tools.check_deliverability`](https://openemail.uk/docs/ruby/reference/tools#checkDeliverability); CLI [`openemail tools check-deliverability`](https://openemail.uk/docs/cli/reference/tools#tools-check-deliverability).
