Skip to content

Commit 16d9376

Browse files
Add Readthedocs documentation.
1 parent 60a0336 commit 16d9376

12 files changed

+560
-0
lines changed

.gitignore

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
#.idea/

.readthedocs.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the OS, Python version and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
# You can also specify other tool versions:
14+
# nodejs: "19"
15+
# rust: "1.64"
16+
# golang: "1.19"
17+
18+
# Build documentation in the "docs/" directory with Sphinx
19+
sphinx:
20+
configuration: docs/source/conf.py
21+
22+
# Optionally build your docs in additional formats such as PDF and ePub
23+
# formats:
24+
# - pdf
25+
# - epub
26+
27+
# Optional but recommended, declare the Python requirements required
28+
# to build your documentation
29+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
30+
python:
31+
install:
32+
- requirements: docs/requirements.txt

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Defining the exact version will make sure things don't break
2+
sphinx-book-theme==1.0.1
3+
# sphinx-pdj-theme==0.4.0
4+
myst-parser==2.0.0
5+
markdown-it-py==3.0.0
6+
sphinx-copybutton==0.5.2

docs/source/code.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# MailboxValidator Python API
2+
3+
## EmailValidation Class
4+
```{py:class} EmailValidation(api_key)
5+
Configure MailboxValidator API key.
6+
7+
:param str api_key: (Required) MailboxValidator API key.
8+
```
9+
10+
```{py:function} validate_email(email)
11+
Validate whether an email address is a valid email or not.
12+
13+
:param str email: (Required) The email address.
14+
15+
:return: Returns the validation result in JSON object.
16+
:rtype: Object
17+
18+
**Successful Response Parameters**
19+
| Field Name | Description |
20+
|-----------|------------|
21+
| email_address | The input email address. |
22+
| base_email_address | The input email address after sanitizing the username of the dots (only Gmail) and [subaddressing](https://en.wikipedia.org/wiki/Email_address#Sub-addressing). |
23+
| domain | The domain of the email address. |
24+
| is_free | Whether the email address is from a free email provider like Gmail or Hotmail. Return values: true, false, null (null means not applicable) |
25+
| is_syntax | Whether the email address is syntactically correct. Return values: true, false |
26+
| is_domain | Whether the email address has a valid MX record in its DNS entries. Return values: true, false, null (null means not applicable) |
27+
| is_smtp | Whether the mail servers specified in the MX records are responding to connections. Return values: true, false, null (null means not applicable) |
28+
| is_verified | Whether the mail server confirms that the email address actually exist. Return values: true, false, null (null means not applicable) |
29+
| is_server_down | Whether the mail server is currently down or unresponsive. Return values: true, false, null (null means not applicable) |
30+
| is_greylisted | Whether the mail server employs greylisting where an email has to be sent a second time at a later time. Return values: true, false, null (null means not applicable) |
31+
| is_disposable | Whether the email address is a temporary one from a disposable email provider. Return values: true, false, null (null means not applicable) |
32+
| is_suppressed | Whether the email address is in our blacklist. Return values: true, false, null (null means not applicable) |
33+
| is_role | Whether the email address is a role-based email address like admin@example.net or webmaster@example.net. Return values: true, false, null (null means not applicable) |
34+
| is_high_risk | Whether the email address contains high risk keywords. Return values: true, false, null (null means not applicable) |
35+
| is_catchall | Whether the email address is a catch-all address. Return values: true, false, null (null means not applicable) |
36+
| is_dmarc_enforced | Whether the email domain is enforcing DMARC. Return values: true, false |
37+
| is_strict_spf | Whether the email domain is using strict SPF. Return values: true, false |
38+
| website_exist | Whether the email domain is a reachable website. Return values: true, false |
39+
| mailboxvalidator_score | Email address reputation score. Score > 0.70 means good; score > 0.40 means fair; score <= 0.40 means poor. |
40+
| time_taken | The time taken to get the results in seconds. |
41+
| status | Whether our system think the email address is valid based on all the previous fields. Return values: True, False |
42+
| credits_available | The number of credits left to perform validations. |
43+
44+
**Error Response Parameters**
45+
| Field Name | Description |
46+
|-----------|------------|
47+
| error.error_code | The error code if there is any error. See error table in the [Error Codes](reference.md) section. |
48+
| error.error_message | The error message if there is any error. See error table in the [Error Codes](reference.md) section. |
49+
50+
```
51+
52+
```{py:function} is_disposable_email(email)
53+
Validate whether an email address is a disposable email or not.
54+
55+
:param str email: (Required) The email address.
56+
57+
:return: Returns the validation result in JSON object.
58+
:rtype: Object
59+
60+
**Successful Response Parameters**
61+
| Field Name | Description |
62+
|-----------|------------|
63+
| email_address | The input email address. |
64+
| is_disposable | Whether the email address is a temporary one from a disposable email provider. Return values: True, False |
65+
| credits_available | The number of credits left to perform validations. |
66+
67+
68+
**Error Response Parameters**
69+
| Field Name | Description |
70+
|-----------|------------|
71+
| error.error_code | The error code if there is any error. See error table in the [Error Codes](reference.md) section. |
72+
| error.error_message | The error message if there is any error. See error table in the [Error Codes](reference.md) section. |
73+
74+
```
75+
76+
```{py:function} is_free_email(email)
77+
Validate whether an email address is a free email or not.
78+
79+
:param str email: (Required) The email address.
80+
81+
:return: Returns the validation result in JSON object.
82+
:rtype: Object
83+
84+
**Successful Response Parameters**
85+
| Field Name | Description |
86+
|-----------|------------|
87+
| email_address | The input email address. |
88+
| is_free | Whether the email address is from a free email provider like Gmail or Hotmail. Return values: True, False |
89+
| credits_available | The number of credits left to perform validations. |
90+
91+
92+
**Error Response Parameters**
93+
| Field Name | Description |
94+
|-----------|------------|
95+
| error.error_code | The error code if there is any error. See error table in the [Error Codes](reference.md) section. |
96+
| error.error_message | The error message if there is any error. See error table in the [Error Codes](reference.md) section. |
97+
98+
```
99+

0 commit comments

Comments
 (0)