opportify-sdk 0.1.3__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of opportify-sdk might be problematic. Click here for more details.
- opportify_sdk-0.2.0/PKG-INFO +239 -0
- opportify_sdk-0.2.0/README.md +218 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/pyproject.toml +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/setup.py +1 -1
- opportify_sdk-0.2.0/src/openapi_client/__init__.py +86 -0
- opportify_sdk-0.2.0/src/openapi_client/api/email_insights_api.py +883 -0
- opportify_sdk-0.2.0/src/openapi_client/api/ip_insights_api.py +886 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/api_client.py +2 -2
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/configuration.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/exceptions.py +18 -1
- opportify_sdk-0.2.0/src/openapi_client/models/__init__.py +68 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/abuse_contact.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/admin_contact.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email200_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email400_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email400_response_error.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email403_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email403_response_error.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email500_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email500_response_error.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_email_request.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_ip200_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_ip400_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_ip400_response_error.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_ip404_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_ip500_response.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/analyze_ip_request.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/asn.py +1 -1
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails202_response.py +101 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails400_response.py +91 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails400_response_error.py +137 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails403_response.py +91 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails403_response_error.py +89 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails413_response.py +91 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails413_response_error.py +89 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_emails_request.py +91 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_ips400_response.py +91 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_ips400_response_error.py +137 -0
- opportify_sdk-0.2.0/src/openapi_client/models/batch_analyze_ips_request.py +89 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/block_listed.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/email_dns.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/geo.py +1 -1
- opportify_sdk-0.2.0/src/openapi_client/models/get_email_batch_status200_response.py +109 -0
- opportify_sdk-0.2.0/src/openapi_client/models/get_email_batch_status200_response_download_urls.py +93 -0
- opportify_sdk-0.2.0/src/openapi_client/models/get_email_batch_status404_response.py +91 -0
- opportify_sdk-0.2.0/src/openapi_client/models/get_email_batch_status404_response_error.py +89 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/internalerror.py +1 -1
- opportify_sdk-0.2.0/src/openapi_client/models/invaliddata.py +89 -0
- opportify_sdk-0.2.0/src/openapi_client/models/invaliddata1.py +89 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/invalidemail.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/invalidplan.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/invalidtoken.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/ipvalidationfailed.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/malformedrequest.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/malformedrequest1.py +1 -1
- opportify_sdk-0.2.0/src/openapi_client/models/malformedrequest2.py +89 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/notfound.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/organization.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/risk_report_email.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/risk_report_ip.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/tech_contact.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/trusted_provider.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/models/whois.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/rest.py +1 -1
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk/email_insights.py +79 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk/ip_insights.py +74 -0
- opportify_sdk-0.2.0/src/opportify_sdk.egg-info/PKG-INFO +239 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk.egg-info/SOURCES.txt +42 -2
- opportify_sdk-0.2.0/test/test_abuse_contact.py +57 -0
- opportify_sdk-0.2.0/test/test_admin_contact.py +57 -0
- opportify_sdk-0.2.0/test/test_analyze_email200_response.py +80 -0
- opportify_sdk-0.2.0/test/test_analyze_email400_response.py +51 -0
- opportify_sdk-0.2.0/test/test_analyze_email400_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_analyze_email403_response.py +51 -0
- opportify_sdk-0.2.0/test/test_analyze_email403_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_analyze_email500_response.py +53 -0
- opportify_sdk-0.2.0/test/test_analyze_email500_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_analyze_email_request.py +54 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/test/test_analyze_ip200_response.py +3 -3
- opportify_sdk-0.2.0/test/test_analyze_ip400_response.py +51 -0
- opportify_sdk-0.2.0/test/test_analyze_ip400_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_analyze_ip404_response.py +53 -0
- opportify_sdk-0.2.0/test/test_analyze_ip500_response.py +53 -0
- opportify_sdk-0.2.0/test/test_analyze_ip_request.py +53 -0
- opportify_sdk-0.2.0/test/test_asn.py +54 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails202_response.py +53 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails400_response.py +51 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails400_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails403_response.py +53 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails403_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails413_response.py +53 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails413_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_emails_request.py +54 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_ips400_response.py +51 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_ips400_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_batch_analyze_ips_request.py +53 -0
- opportify_sdk-0.2.0/test/test_block_listed.py +57 -0
- opportify_sdk-0.2.0/test/test_email_dns.py +51 -0
- opportify_sdk-0.2.0/test/test_email_insights_api.py +52 -0
- opportify_sdk-0.2.0/test/test_geo.py +64 -0
- opportify_sdk-0.2.0/test/test_get_email_batch_status200_response.py +59 -0
- opportify_sdk-0.2.0/test/test_get_email_batch_status200_response_download_urls.py +54 -0
- opportify_sdk-0.2.0/test/test_get_email_batch_status404_response.py +53 -0
- opportify_sdk-0.2.0/test/test_get_email_batch_status404_response_error.py +52 -0
- opportify_sdk-0.2.0/test/test_internalerror.py +52 -0
- opportify_sdk-0.2.0/test/test_invaliddata.py +52 -0
- opportify_sdk-0.2.0/test/test_invaliddata1.py +52 -0
- opportify_sdk-0.2.0/test/test_invalidemail.py +52 -0
- opportify_sdk-0.2.0/test/test_invalidplan.py +52 -0
- opportify_sdk-0.2.0/test/test_invalidtoken.py +52 -0
- opportify_sdk-0.2.0/test/test_ip_insights_api.py +52 -0
- opportify_sdk-0.2.0/test/test_ipvalidationfailed.py +52 -0
- opportify_sdk-0.2.0/test/test_malformedrequest.py +52 -0
- opportify_sdk-0.2.0/test/test_malformedrequest1.py +52 -0
- opportify_sdk-0.2.0/test/test_malformedrequest2.py +52 -0
- opportify_sdk-0.2.0/test/test_notfound.py +52 -0
- opportify_sdk-0.2.0/test/test_organization.py +59 -0
- opportify_sdk-0.2.0/test/test_risk_report_email.py +53 -0
- opportify_sdk-0.2.0/test/test_risk_report_ip.py +52 -0
- opportify_sdk-0.2.0/test/test_tech_contact.py +57 -0
- opportify_sdk-0.2.0/test/test_trusted_provider.py +55 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/test/test_whois.py +1 -1
- opportify_sdk-0.1.3/PKG-INFO +0 -115
- opportify_sdk-0.1.3/README.md +0 -94
- opportify_sdk-0.1.3/src/openapi_client/__init__.py +0 -68
- opportify_sdk-0.1.3/src/openapi_client/api/email_insights_api.py +0 -320
- opportify_sdk-0.1.3/src/openapi_client/api/ip_insights_api.py +0 -323
- opportify_sdk-0.1.3/src/openapi_client/models/__init__.py +0 -50
- opportify_sdk-0.1.3/src/openapi_client/models/risk_report.py +0 -89
- opportify_sdk-0.1.3/src/opportify_sdk.egg-info/PKG-INFO +0 -115
- opportify_sdk-0.1.3/test/test_abuse_contact.py +0 -57
- opportify_sdk-0.1.3/test/test_admin_contact.py +0 -57
- opportify_sdk-0.1.3/test/test_analyze_email200_response.py +0 -76
- opportify_sdk-0.1.3/test/test_analyze_email400_response.py +0 -51
- opportify_sdk-0.1.3/test/test_analyze_email400_response_error.py +0 -52
- opportify_sdk-0.1.3/test/test_analyze_email500_response.py +0 -53
- opportify_sdk-0.1.3/test/test_analyze_email500_response_error.py +0 -52
- opportify_sdk-0.1.3/test/test_analyze_email_request.py +0 -54
- opportify_sdk-0.1.3/test/test_analyze_ip400_response.py +0 -51
- opportify_sdk-0.1.3/test/test_analyze_ip400_response_error.py +0 -52
- opportify_sdk-0.1.3/test/test_analyze_ip404_response.py +0 -53
- opportify_sdk-0.1.3/test/test_analyze_ip500_response.py +0 -53
- opportify_sdk-0.1.3/test/test_analyze_ip_request.py +0 -53
- opportify_sdk-0.1.3/test/test_asn.py +0 -54
- opportify_sdk-0.1.3/test/test_block_listed.py +0 -57
- opportify_sdk-0.1.3/test/test_email_dns.py +0 -51
- opportify_sdk-0.1.3/test/test_email_insights_api.py +0 -38
- opportify_sdk-0.1.3/test/test_geo.py +0 -64
- opportify_sdk-0.1.3/test/test_internalerror.py +0 -52
- opportify_sdk-0.1.3/test/test_invalidemail.py +0 -52
- opportify_sdk-0.1.3/test/test_ip_insights_api.py +0 -38
- opportify_sdk-0.1.3/test/test_ipvalidationfailed.py +0 -52
- opportify_sdk-0.1.3/test/test_malformedrequest.py +0 -52
- opportify_sdk-0.1.3/test/test_malformedrequest1.py +0 -52
- opportify_sdk-0.1.3/test/test_notfound.py +0 -52
- opportify_sdk-0.1.3/test/test_organization.py +0 -59
- opportify_sdk-0.1.3/test/test_risk_report.py +0 -52
- opportify_sdk-0.1.3/test/test_tech_contact.py +0 -57
- opportify_sdk-0.1.3/test/test_trusted_provider.py +0 -55
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/setup.cfg +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/api/__init__.py +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/api_response.py +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/openapi_client/py.typed +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk/__init__.py +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk.egg-info/dependency_links.txt +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk.egg-info/requires.txt +0 -0
- {opportify_sdk-0.1.3 → opportify_sdk-0.2.0}/src/opportify_sdk.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opportify_sdk
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Opportify Insights API
|
|
5
|
+
Home-page: https://github.com/opportify/opportify-sdk-python
|
|
6
|
+
Author: Opportify & OpenAPI-Generator
|
|
7
|
+
Author-email:
|
|
8
|
+
Keywords: OpenAPI,OpenAPI-Generator,Opportify Insights API,Opportify
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: urllib3<3.0.0,>=1.25.3
|
|
11
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
12
|
+
Requires-Dist: pydantic>=2
|
|
13
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: keywords
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# Opportify-SDK-Python
|
|
23
|
+
|
|
24
|
+
## Overview
|
|
25
|
+
|
|
26
|
+
The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks.
|
|
27
|
+
|
|
28
|
+
[Sign Up Free](https://www.opportify.ai)
|
|
29
|
+
|
|
30
|
+
### Base URL
|
|
31
|
+
Use the following base URL for all API requests:
|
|
32
|
+
|
|
33
|
+
```plaintext
|
|
34
|
+
https://api.opportify.ai/insights/v1/<service>/<endpoint>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
Requires Python v3.8 or later
|
|
40
|
+
|
|
41
|
+
## Getting Started
|
|
42
|
+
|
|
43
|
+
First, install Opportify SDK via PyPI manager:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
pip install opportify-sdk
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Single Analysis
|
|
50
|
+
|
|
51
|
+
### Calling Email Insights
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from opportify_sdk import EmailInsights
|
|
55
|
+
|
|
56
|
+
# Initialize the wrapper with your API key
|
|
57
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
58
|
+
email_insights = EmailInsights(api_key)
|
|
59
|
+
|
|
60
|
+
# Optional: Configure host, version, and debug mode
|
|
61
|
+
email_insights.set_version("v1")
|
|
62
|
+
|
|
63
|
+
# Define request parameters
|
|
64
|
+
params = {
|
|
65
|
+
"email": "<SOME-EMAIL-HERE>",
|
|
66
|
+
"enableAutoCorrection": True,
|
|
67
|
+
"enableAi": True
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# Call the API
|
|
71
|
+
try:
|
|
72
|
+
result = email_insights.analyze(params)
|
|
73
|
+
print("Response:", result)
|
|
74
|
+
except Exception as e:
|
|
75
|
+
print(f"Error: {e}")
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Calling IP Insights
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
|
|
82
|
+
from opportify_sdk import IpInsights
|
|
83
|
+
|
|
84
|
+
# Initialize the wrapper with your API key
|
|
85
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
86
|
+
ip_insights = IpInsights(api_key)
|
|
87
|
+
|
|
88
|
+
# Optional: Configure host, version, and debug mode
|
|
89
|
+
ip_insights.set_version("v1")
|
|
90
|
+
|
|
91
|
+
# Define request parameters
|
|
92
|
+
params = {
|
|
93
|
+
"ip": "<SOME-IP-HERE>",
|
|
94
|
+
"enableAi": True
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
# Call the API
|
|
98
|
+
try:
|
|
99
|
+
result = ip_insights.analyze(params)
|
|
100
|
+
print("Response:", result)
|
|
101
|
+
except Exception as e:
|
|
102
|
+
print(f"Error: {e}")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Batch Analysis
|
|
106
|
+
|
|
107
|
+
For processing large volumes of emails or IP addresses, use the batch analysis methods:
|
|
108
|
+
|
|
109
|
+
### Batch Email Analysis
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from opportify_sdk import EmailInsights
|
|
113
|
+
|
|
114
|
+
# Initialize the wrapper with your API key
|
|
115
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
116
|
+
email_insights = EmailInsights(api_key)
|
|
117
|
+
|
|
118
|
+
# Define batch request parameters
|
|
119
|
+
batch_params = {
|
|
120
|
+
"emails": [
|
|
121
|
+
"user1@company.com",
|
|
122
|
+
"user2@domain.org",
|
|
123
|
+
"test@example.com"
|
|
124
|
+
],
|
|
125
|
+
"enableAutoCorrection": True,
|
|
126
|
+
"enableAi": True
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# Start batch analysis
|
|
130
|
+
try:
|
|
131
|
+
batch_response = email_insights.batch_analyze(batch_params)
|
|
132
|
+
job_id = batch_response['job_id']
|
|
133
|
+
print(f"Batch job started: {job_id}")
|
|
134
|
+
|
|
135
|
+
# Check batch status
|
|
136
|
+
status = email_insights.get_batch_status(job_id)
|
|
137
|
+
print(f"Status: {status['status']}, Progress: {status['progress']}%")
|
|
138
|
+
|
|
139
|
+
# When completed, download URLs will be available
|
|
140
|
+
if status['status'] == 'COMPLETED':
|
|
141
|
+
download_urls = status['download_urls']
|
|
142
|
+
print(f"Results ready: {download_urls['csv']}")
|
|
143
|
+
|
|
144
|
+
except Exception as e:
|
|
145
|
+
print(f"Error: {e}")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Batch IP Analysis
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
from opportify_sdk import IpInsights
|
|
152
|
+
|
|
153
|
+
# Initialize the wrapper with your API key
|
|
154
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
155
|
+
ip_insights = IpInsights(api_key)
|
|
156
|
+
|
|
157
|
+
# Define batch request parameters
|
|
158
|
+
batch_params = {
|
|
159
|
+
"ips": [
|
|
160
|
+
"8.8.8.8",
|
|
161
|
+
"1.1.1.1",
|
|
162
|
+
"192.168.1.1"
|
|
163
|
+
],
|
|
164
|
+
"enableAi": True
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
# Start batch analysis
|
|
168
|
+
try:
|
|
169
|
+
batch_response = ip_insights.batch_analyze(batch_params)
|
|
170
|
+
job_id = batch_response['job_id']
|
|
171
|
+
print(f"Batch job started: {job_id}")
|
|
172
|
+
|
|
173
|
+
# Check batch status
|
|
174
|
+
status = ip_insights.get_batch_status(job_id)
|
|
175
|
+
print(f"Status: {status['status']}, Progress: {status['progress']}%")
|
|
176
|
+
|
|
177
|
+
# When completed, download URLs will be available
|
|
178
|
+
if status['status'] == 'COMPLETED':
|
|
179
|
+
download_urls = status['download_urls']
|
|
180
|
+
print(f"Results ready: {download_urls['csv']}")
|
|
181
|
+
|
|
182
|
+
except Exception as e:
|
|
183
|
+
print(f"Error: {e}")
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Configuration
|
|
187
|
+
|
|
188
|
+
### Enable Debug Mode
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
ip_insights.set_version("v1").set_debug_mode(True)
|
|
192
|
+
email_insights.set_version("v1").set_debug_mode(True)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Batch Status Polling
|
|
196
|
+
|
|
197
|
+
For long-running batch jobs, poll the status periodically:
|
|
198
|
+
|
|
199
|
+
```python
|
|
200
|
+
import time
|
|
201
|
+
|
|
202
|
+
def wait_for_batch_completion(client, job_id, max_wait=300):
|
|
203
|
+
"""Wait for batch job to complete with polling."""
|
|
204
|
+
start_time = time.time()
|
|
205
|
+
|
|
206
|
+
while time.time() - start_time < max_wait:
|
|
207
|
+
status = client.get_batch_status(job_id)
|
|
208
|
+
|
|
209
|
+
if status['status'] == 'COMPLETED':
|
|
210
|
+
return status
|
|
211
|
+
elif status['status'] == 'ERROR':
|
|
212
|
+
raise Exception(f"Batch job failed: {status.get('status_description')}")
|
|
213
|
+
|
|
214
|
+
print(f"Progress: {status.get('progress', 0)}%")
|
|
215
|
+
time.sleep(10) # Wait 10 seconds before next check
|
|
216
|
+
|
|
217
|
+
raise TimeoutError("Batch job did not complete within the timeout period")
|
|
218
|
+
|
|
219
|
+
# Usage
|
|
220
|
+
try:
|
|
221
|
+
batch_response = email_insights.batch_analyze(batch_params)
|
|
222
|
+
final_status = wait_for_batch_completion(email_insights, batch_response['job_id'])
|
|
223
|
+
print("Batch completed successfully!")
|
|
224
|
+
except Exception as e:
|
|
225
|
+
print(f"Error: {e}")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## About this package
|
|
229
|
+
|
|
230
|
+
This Python package supports both single and batch analysis operations and is a customization of the base generated by:
|
|
231
|
+
|
|
232
|
+
- [OpenAPI Generator](https://openapi-generator.tech) project.
|
|
233
|
+
|
|
234
|
+
## Additional Resources
|
|
235
|
+
|
|
236
|
+
- **[Batch Processing Guide](BATCH_PROCESSING_GUIDE.md)** - Comprehensive guide for batch operations
|
|
237
|
+
- **[API Documentation](https://api.opportify.ai/docs)** - Full API reference
|
|
238
|
+
- **[Support](https://www.opportify.ai/support)** - Get help and support
|
|
239
|
+
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Opportify-SDK-Python
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks.
|
|
6
|
+
|
|
7
|
+
[Sign Up Free](https://www.opportify.ai)
|
|
8
|
+
|
|
9
|
+
### Base URL
|
|
10
|
+
Use the following base URL for all API requests:
|
|
11
|
+
|
|
12
|
+
```plaintext
|
|
13
|
+
https://api.opportify.ai/insights/v1/<service>/<endpoint>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Requirements
|
|
17
|
+
|
|
18
|
+
Requires Python v3.8 or later
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
First, install Opportify SDK via PyPI manager:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
pip install opportify-sdk
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Single Analysis
|
|
29
|
+
|
|
30
|
+
### Calling Email Insights
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from opportify_sdk import EmailInsights
|
|
34
|
+
|
|
35
|
+
# Initialize the wrapper with your API key
|
|
36
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
37
|
+
email_insights = EmailInsights(api_key)
|
|
38
|
+
|
|
39
|
+
# Optional: Configure host, version, and debug mode
|
|
40
|
+
email_insights.set_version("v1")
|
|
41
|
+
|
|
42
|
+
# Define request parameters
|
|
43
|
+
params = {
|
|
44
|
+
"email": "<SOME-EMAIL-HERE>",
|
|
45
|
+
"enableAutoCorrection": True,
|
|
46
|
+
"enableAi": True
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Call the API
|
|
50
|
+
try:
|
|
51
|
+
result = email_insights.analyze(params)
|
|
52
|
+
print("Response:", result)
|
|
53
|
+
except Exception as e:
|
|
54
|
+
print(f"Error: {e}")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Calling IP Insights
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
|
|
61
|
+
from opportify_sdk import IpInsights
|
|
62
|
+
|
|
63
|
+
# Initialize the wrapper with your API key
|
|
64
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
65
|
+
ip_insights = IpInsights(api_key)
|
|
66
|
+
|
|
67
|
+
# Optional: Configure host, version, and debug mode
|
|
68
|
+
ip_insights.set_version("v1")
|
|
69
|
+
|
|
70
|
+
# Define request parameters
|
|
71
|
+
params = {
|
|
72
|
+
"ip": "<SOME-IP-HERE>",
|
|
73
|
+
"enableAi": True
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Call the API
|
|
77
|
+
try:
|
|
78
|
+
result = ip_insights.analyze(params)
|
|
79
|
+
print("Response:", result)
|
|
80
|
+
except Exception as e:
|
|
81
|
+
print(f"Error: {e}")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Batch Analysis
|
|
85
|
+
|
|
86
|
+
For processing large volumes of emails or IP addresses, use the batch analysis methods:
|
|
87
|
+
|
|
88
|
+
### Batch Email Analysis
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from opportify_sdk import EmailInsights
|
|
92
|
+
|
|
93
|
+
# Initialize the wrapper with your API key
|
|
94
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
95
|
+
email_insights = EmailInsights(api_key)
|
|
96
|
+
|
|
97
|
+
# Define batch request parameters
|
|
98
|
+
batch_params = {
|
|
99
|
+
"emails": [
|
|
100
|
+
"user1@company.com",
|
|
101
|
+
"user2@domain.org",
|
|
102
|
+
"test@example.com"
|
|
103
|
+
],
|
|
104
|
+
"enableAutoCorrection": True,
|
|
105
|
+
"enableAi": True
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Start batch analysis
|
|
109
|
+
try:
|
|
110
|
+
batch_response = email_insights.batch_analyze(batch_params)
|
|
111
|
+
job_id = batch_response['job_id']
|
|
112
|
+
print(f"Batch job started: {job_id}")
|
|
113
|
+
|
|
114
|
+
# Check batch status
|
|
115
|
+
status = email_insights.get_batch_status(job_id)
|
|
116
|
+
print(f"Status: {status['status']}, Progress: {status['progress']}%")
|
|
117
|
+
|
|
118
|
+
# When completed, download URLs will be available
|
|
119
|
+
if status['status'] == 'COMPLETED':
|
|
120
|
+
download_urls = status['download_urls']
|
|
121
|
+
print(f"Results ready: {download_urls['csv']}")
|
|
122
|
+
|
|
123
|
+
except Exception as e:
|
|
124
|
+
print(f"Error: {e}")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Batch IP Analysis
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from opportify_sdk import IpInsights
|
|
131
|
+
|
|
132
|
+
# Initialize the wrapper with your API key
|
|
133
|
+
api_key = "<YOUR-API-KEY-HERE>"
|
|
134
|
+
ip_insights = IpInsights(api_key)
|
|
135
|
+
|
|
136
|
+
# Define batch request parameters
|
|
137
|
+
batch_params = {
|
|
138
|
+
"ips": [
|
|
139
|
+
"8.8.8.8",
|
|
140
|
+
"1.1.1.1",
|
|
141
|
+
"192.168.1.1"
|
|
142
|
+
],
|
|
143
|
+
"enableAi": True
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# Start batch analysis
|
|
147
|
+
try:
|
|
148
|
+
batch_response = ip_insights.batch_analyze(batch_params)
|
|
149
|
+
job_id = batch_response['job_id']
|
|
150
|
+
print(f"Batch job started: {job_id}")
|
|
151
|
+
|
|
152
|
+
# Check batch status
|
|
153
|
+
status = ip_insights.get_batch_status(job_id)
|
|
154
|
+
print(f"Status: {status['status']}, Progress: {status['progress']}%")
|
|
155
|
+
|
|
156
|
+
# When completed, download URLs will be available
|
|
157
|
+
if status['status'] == 'COMPLETED':
|
|
158
|
+
download_urls = status['download_urls']
|
|
159
|
+
print(f"Results ready: {download_urls['csv']}")
|
|
160
|
+
|
|
161
|
+
except Exception as e:
|
|
162
|
+
print(f"Error: {e}")
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Configuration
|
|
166
|
+
|
|
167
|
+
### Enable Debug Mode
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
ip_insights.set_version("v1").set_debug_mode(True)
|
|
171
|
+
email_insights.set_version("v1").set_debug_mode(True)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Batch Status Polling
|
|
175
|
+
|
|
176
|
+
For long-running batch jobs, poll the status periodically:
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
import time
|
|
180
|
+
|
|
181
|
+
def wait_for_batch_completion(client, job_id, max_wait=300):
|
|
182
|
+
"""Wait for batch job to complete with polling."""
|
|
183
|
+
start_time = time.time()
|
|
184
|
+
|
|
185
|
+
while time.time() - start_time < max_wait:
|
|
186
|
+
status = client.get_batch_status(job_id)
|
|
187
|
+
|
|
188
|
+
if status['status'] == 'COMPLETED':
|
|
189
|
+
return status
|
|
190
|
+
elif status['status'] == 'ERROR':
|
|
191
|
+
raise Exception(f"Batch job failed: {status.get('status_description')}")
|
|
192
|
+
|
|
193
|
+
print(f"Progress: {status.get('progress', 0)}%")
|
|
194
|
+
time.sleep(10) # Wait 10 seconds before next check
|
|
195
|
+
|
|
196
|
+
raise TimeoutError("Batch job did not complete within the timeout period")
|
|
197
|
+
|
|
198
|
+
# Usage
|
|
199
|
+
try:
|
|
200
|
+
batch_response = email_insights.batch_analyze(batch_params)
|
|
201
|
+
final_status = wait_for_batch_completion(email_insights, batch_response['job_id'])
|
|
202
|
+
print("Batch completed successfully!")
|
|
203
|
+
except Exception as e:
|
|
204
|
+
print(f"Error: {e}")
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## About this package
|
|
208
|
+
|
|
209
|
+
This Python package supports both single and batch analysis operations and is a customization of the base generated by:
|
|
210
|
+
|
|
211
|
+
- [OpenAPI Generator](https://openapi-generator.tech) project.
|
|
212
|
+
|
|
213
|
+
## Additional Resources
|
|
214
|
+
|
|
215
|
+
- **[Batch Processing Guide](BATCH_PROCESSING_GUIDE.md)** - Comprehensive guide for batch operations
|
|
216
|
+
- **[API Documentation](https://api.opportify.ai/docs)** - Full API reference
|
|
217
|
+
- **[Support](https://www.opportify.ai/support)** - Get help and support
|
|
218
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Opportify Insights API
|
|
7
|
+
|
|
8
|
+
## Overview The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks. ### Base URL Use the following base URL for all API requests: ```plaintext https://api.opportify.ai/insights/v1/<service>/<endpoint> ``` ### Features - [**Email Insights:**](/docs/api/api-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, private or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. [Access Documentation >>](/docs/api/api-reference/email-insights) - [**IP Insights:**](/docs/api/api-reference/ip-insights) - Connection types: Detects connection types such as `wired`, `mobile`, `enterprise`, `satellite`, `VPN`, `cloud-provider`, `open-proxy`, or `Tor`. - Geo location: Delivers detailed insights such as country, city, timezone, language preferences, and additional location-based information to enhance regional understanding. - WHOIS: Provides main details including RIR, ASN, organization, and abuse/admin/technical contacts. - Trusted Provider Recognition: Identifies if the IP is part of a known trusted provider (e.g., ZTNA - Zero Trust Network Access). - Blocklist Reports: Retrieves up-to-date blocklist statuses, active reports, and the latest detections. - Risk Report: Delivers an AI-driven normalized score (200-1000) to evaluate IP risk, supported by predefined thresholds. [Access Documentation >>](/docs/api/api-reference/ip-insights) ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: 1.0.0
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
__version__ = "1.0.0"
|
|
18
|
+
|
|
19
|
+
# import apis into sdk package
|
|
20
|
+
from openapi_client.api.email_insights_api import EmailInsightsApi
|
|
21
|
+
from openapi_client.api.ip_insights_api import IPInsightsApi
|
|
22
|
+
|
|
23
|
+
# import ApiClient
|
|
24
|
+
from openapi_client.api_response import ApiResponse
|
|
25
|
+
from openapi_client.api_client import ApiClient
|
|
26
|
+
from openapi_client.configuration import Configuration
|
|
27
|
+
from openapi_client.exceptions import OpenApiException
|
|
28
|
+
from openapi_client.exceptions import ApiTypeError
|
|
29
|
+
from openapi_client.exceptions import ApiValueError
|
|
30
|
+
from openapi_client.exceptions import ApiKeyError
|
|
31
|
+
from openapi_client.exceptions import ApiAttributeError
|
|
32
|
+
from openapi_client.exceptions import ApiException
|
|
33
|
+
|
|
34
|
+
# import models into sdk package
|
|
35
|
+
from openapi_client.models.abuse_contact import AbuseContact
|
|
36
|
+
from openapi_client.models.admin_contact import AdminContact
|
|
37
|
+
from openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
|
|
38
|
+
from openapi_client.models.analyze_email400_response import AnalyzeEmail400Response
|
|
39
|
+
from openapi_client.models.analyze_email400_response_error import AnalyzeEmail400ResponseError
|
|
40
|
+
from openapi_client.models.analyze_email403_response import AnalyzeEmail403Response
|
|
41
|
+
from openapi_client.models.analyze_email403_response_error import AnalyzeEmail403ResponseError
|
|
42
|
+
from openapi_client.models.analyze_email500_response import AnalyzeEmail500Response
|
|
43
|
+
from openapi_client.models.analyze_email500_response_error import AnalyzeEmail500ResponseError
|
|
44
|
+
from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
|
|
45
|
+
from openapi_client.models.analyze_ip200_response import AnalyzeIp200Response
|
|
46
|
+
from openapi_client.models.analyze_ip400_response import AnalyzeIp400Response
|
|
47
|
+
from openapi_client.models.analyze_ip400_response_error import AnalyzeIp400ResponseError
|
|
48
|
+
from openapi_client.models.analyze_ip404_response import AnalyzeIp404Response
|
|
49
|
+
from openapi_client.models.analyze_ip500_response import AnalyzeIp500Response
|
|
50
|
+
from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
|
|
51
|
+
from openapi_client.models.asn import Asn
|
|
52
|
+
from openapi_client.models.batch_analyze_emails202_response import BatchAnalyzeEmails202Response
|
|
53
|
+
from openapi_client.models.batch_analyze_emails400_response import BatchAnalyzeEmails400Response
|
|
54
|
+
from openapi_client.models.batch_analyze_emails400_response_error import BatchAnalyzeEmails400ResponseError
|
|
55
|
+
from openapi_client.models.batch_analyze_emails403_response import BatchAnalyzeEmails403Response
|
|
56
|
+
from openapi_client.models.batch_analyze_emails403_response_error import BatchAnalyzeEmails403ResponseError
|
|
57
|
+
from openapi_client.models.batch_analyze_emails413_response import BatchAnalyzeEmails413Response
|
|
58
|
+
from openapi_client.models.batch_analyze_emails413_response_error import BatchAnalyzeEmails413ResponseError
|
|
59
|
+
from openapi_client.models.batch_analyze_emails_request import BatchAnalyzeEmailsRequest
|
|
60
|
+
from openapi_client.models.batch_analyze_ips400_response import BatchAnalyzeIps400Response
|
|
61
|
+
from openapi_client.models.batch_analyze_ips400_response_error import BatchAnalyzeIps400ResponseError
|
|
62
|
+
from openapi_client.models.batch_analyze_ips_request import BatchAnalyzeIpsRequest
|
|
63
|
+
from openapi_client.models.block_listed import BlockListed
|
|
64
|
+
from openapi_client.models.email_dns import EmailDNS
|
|
65
|
+
from openapi_client.models.geo import Geo
|
|
66
|
+
from openapi_client.models.get_email_batch_status200_response import GetEmailBatchStatus200Response
|
|
67
|
+
from openapi_client.models.get_email_batch_status200_response_download_urls import GetEmailBatchStatus200ResponseDownloadUrls
|
|
68
|
+
from openapi_client.models.get_email_batch_status404_response import GetEmailBatchStatus404Response
|
|
69
|
+
from openapi_client.models.get_email_batch_status404_response_error import GetEmailBatchStatus404ResponseError
|
|
70
|
+
from openapi_client.models.internalerror import INTERNALERROR
|
|
71
|
+
from openapi_client.models.invaliddata import INVALIDDATA
|
|
72
|
+
from openapi_client.models.invaliddata1 import INVALIDDATA1
|
|
73
|
+
from openapi_client.models.invalidemail import INVALIDEMAIL
|
|
74
|
+
from openapi_client.models.invalidplan import INVALIDPLAN
|
|
75
|
+
from openapi_client.models.invalidtoken import INVALIDTOKEN
|
|
76
|
+
from openapi_client.models.ipvalidationfailed import IPVALIDATIONFAILED
|
|
77
|
+
from openapi_client.models.malformedrequest import MALFORMEDREQUEST
|
|
78
|
+
from openapi_client.models.malformedrequest1 import MALFORMEDREQUEST1
|
|
79
|
+
from openapi_client.models.malformedrequest2 import MALFORMEDREQUEST2
|
|
80
|
+
from openapi_client.models.notfound import NOTFOUND
|
|
81
|
+
from openapi_client.models.organization import Organization
|
|
82
|
+
from openapi_client.models.risk_report_email import RiskReportEmail
|
|
83
|
+
from openapi_client.models.risk_report_ip import RiskReportIp
|
|
84
|
+
from openapi_client.models.tech_contact import TechContact
|
|
85
|
+
from openapi_client.models.trusted_provider import TrustedProvider
|
|
86
|
+
from openapi_client.models.whois import Whois
|