opportify-sdk 0.1.1__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.

Files changed (113) hide show
  1. openapi_client/__init__.py +186 -0
  2. openapi_client/api/email_insights_api.py +1491 -0
  3. openapi_client/api/ip_insights_api.py +1494 -0
  4. {lib/v1/openapi_client → openapi_client}/api_client.py +14 -7
  5. {lib/v1/openapi_client → openapi_client}/configuration.py +16 -5
  6. {lib/v1/openapi_client → openapi_client}/exceptions.py +18 -1
  7. openapi_client/models/__init__.py +84 -0
  8. {lib/v1/openapi_client → openapi_client}/models/abuse_contact.py +1 -1
  9. openapi_client/models/address_signals.py +99 -0
  10. {lib/v1/openapi_client → openapi_client}/models/admin_contact.py +1 -1
  11. openapi_client/models/analyze_email200_response.py +127 -0
  12. lib/v1/openapi_client/models/analyze_email400_response_error.py → openapi_client/models/analyze_email400_response.py +9 -9
  13. openapi_client/models/analyze_email403_response.py +207 -0
  14. openapi_client/models/analyze_email500_response.py +89 -0
  15. openapi_client/models/analyze_email_request.py +94 -0
  16. {lib/v1/openapi_client → openapi_client}/models/analyze_ip200_response.py +4 -4
  17. lib/v1/openapi_client/models/analyze_ip400_response_error.py → openapi_client/models/analyze_ip400_response.py +20 -20
  18. {lib/v1/openapi_client → openapi_client}/models/analyze_ip_request.py +1 -1
  19. {lib/v1/openapi_client → openapi_client}/models/asn.py +1 -1
  20. openapi_client/models/batch_analyze_emails202_response.py +93 -0
  21. openapi_client/models/batch_analyze_emails400_response.py +137 -0
  22. openapi_client/models/batch_analyze_emails401_response.py +89 -0
  23. openapi_client/models/batch_analyze_emails402_response.py +137 -0
  24. openapi_client/models/batch_analyze_emails403_response.py +193 -0
  25. openapi_client/models/batch_analyze_emails413_response.py +89 -0
  26. openapi_client/models/batch_analyze_emails429_response.py +89 -0
  27. openapi_client/models/batch_analyze_emails_request.py +93 -0
  28. openapi_client/models/batch_analyze_ips202_response.py +93 -0
  29. openapi_client/models/batch_analyze_ips400_response.py +137 -0
  30. openapi_client/models/batch_analyze_ips_request.py +91 -0
  31. {lib/v1/openapi_client → openapi_client}/models/block_listed.py +3 -4
  32. openapi_client/models/create_email_batch_export400_response.py +89 -0
  33. openapi_client/models/create_email_batch_export403_response.py +89 -0
  34. openapi_client/models/create_email_batch_export404_response.py +89 -0
  35. openapi_client/models/create_email_batch_export409_response.py +137 -0
  36. openapi_client/models/email_dns.py +97 -0
  37. openapi_client/models/email_domain.py +113 -0
  38. openapi_client/models/export_created_response.py +91 -0
  39. openapi_client/models/export_filter.py +95 -0
  40. openapi_client/models/export_request.py +92 -0
  41. openapi_client/models/export_status_response.py +119 -0
  42. openapi_client/models/exportnotfound.py +89 -0
  43. openapi_client/models/forbidden.py +89 -0
  44. {lib/v1/openapi_client → openapi_client}/models/geo.py +1 -1
  45. openapi_client/models/get_email_batch_export_status400_response.py +89 -0
  46. openapi_client/models/get_email_batch_export_status404_response.py +137 -0
  47. openapi_client/models/get_email_batch_status200_response.py +101 -0
  48. openapi_client/models/get_email_batch_status200_response_download_urls.py +93 -0
  49. openapi_client/models/get_email_batch_status404_response.py +89 -0
  50. openapi_client/models/get_ip_batch_status200_response.py +101 -0
  51. openapi_client/models/internalerror.py +89 -0
  52. openapi_client/models/internalerror1.py +89 -0
  53. openapi_client/models/invaliddata.py +89 -0
  54. openapi_client/models/invaliddata1.py +89 -0
  55. openapi_client/models/invalidemail.py +89 -0
  56. openapi_client/models/invalidplan.py +89 -0
  57. openapi_client/models/invalidplan1.py +89 -0
  58. openapi_client/models/invalidtoken.py +89 -0
  59. openapi_client/models/ipvalidationfailed.py +89 -0
  60. openapi_client/models/jobnotfound.py +89 -0
  61. openapi_client/models/jobnotready.py +89 -0
  62. openapi_client/models/malformedrequest.py +89 -0
  63. openapi_client/models/malformedrequest1.py +89 -0
  64. openapi_client/models/malformedrequest2.py +89 -0
  65. openapi_client/models/malformedrequest3.py +89 -0
  66. openapi_client/models/manifestnotavailable.py +89 -0
  67. openapi_client/models/notfound.py +89 -0
  68. {lib/v1/openapi_client → openapi_client}/models/organization.py +1 -1
  69. openapi_client/models/quotaexceeded.py +89 -0
  70. openapi_client/models/risk_report_email.py +92 -0
  71. openapi_client/models/risk_report_ip.py +89 -0
  72. {lib/v1/openapi_client → openapi_client}/models/tech_contact.py +1 -1
  73. openapi_client/models/toomanyrequests.py +89 -0
  74. {lib/v1/openapi_client → openapi_client}/models/trusted_provider.py +1 -1
  75. {lib/v1/openapi_client → openapi_client}/models/whois.py +2 -2
  76. {lib/v1/openapi_client → openapi_client}/rest.py +2 -1
  77. opportify_sdk/email_insights.py +427 -0
  78. opportify_sdk/ip_insights.py +410 -0
  79. opportify_sdk-0.3.1.dist-info/METADATA +300 -0
  80. opportify_sdk-0.3.1.dist-info/RECORD +86 -0
  81. {opportify_sdk-0.1.1.dist-info → opportify_sdk-0.3.1.dist-info}/WHEEL +1 -1
  82. opportify_sdk-0.3.1.dist-info/top_level.txt +2 -0
  83. lib/__init__.py +0 -0
  84. lib/v1/__init__.py +0 -0
  85. lib/v1/openapi_client/__init__.py +0 -63
  86. lib/v1/openapi_client/api/email_insights_api.py +0 -317
  87. lib/v1/openapi_client/api/ip_insights_api.py +0 -322
  88. lib/v1/openapi_client/models/__init__.py +0 -45
  89. lib/v1/openapi_client/models/analyze_email200_response.py +0 -113
  90. lib/v1/openapi_client/models/analyze_email400_response.py +0 -91
  91. lib/v1/openapi_client/models/analyze_email500_response.py +0 -91
  92. lib/v1/openapi_client/models/analyze_email500_response_error.py +0 -89
  93. lib/v1/openapi_client/models/analyze_email_request.py +0 -92
  94. lib/v1/openapi_client/models/analyze_ip400_response.py +0 -91
  95. lib/v1/openapi_client/models/analyze_ip404_response.py +0 -91
  96. lib/v1/openapi_client/models/analyze_ip500_response.py +0 -91
  97. lib/v1/openapi_client/models/email_dns.py +0 -87
  98. lib/v1/openapi_client/models/internalerror.py +0 -89
  99. lib/v1/openapi_client/models/invalidemail.py +0 -89
  100. lib/v1/openapi_client/models/ipvalidationfailed.py +0 -89
  101. lib/v1/openapi_client/models/malformedrequest.py +0 -89
  102. lib/v1/openapi_client/models/malformedrequest1.py +0 -89
  103. lib/v1/openapi_client/models/notfound.py +0 -89
  104. lib/v1/openapi_client/models/risk_report.py +0 -89
  105. opportify_sdk-0.1.1.dist-info/METADATA +0 -108
  106. opportify_sdk-0.1.1.dist-info/RECORD +0 -49
  107. opportify_sdk-0.1.1.dist-info/top_level.txt +0 -2
  108. src/email_insights.py +0 -97
  109. src/ip_insights.py +0 -93
  110. {lib/v1/openapi_client → openapi_client}/api/__init__.py +0 -0
  111. {lib/v1/openapi_client → openapi_client}/api_response.py +0 -0
  112. {lib/v1/openapi_client → openapi_client}/py.typed +0 -0
  113. {src → opportify_sdk}/__init__.py +0 -0
@@ -1,89 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Opportify Insights API
5
-
6
- ## 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-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate 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-reference/email-insights) - [**IP Insights:**](/docs/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-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.
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
- import pprint
17
- import re # noqa: F401
18
- import json
19
-
20
- from pydantic import BaseModel, ConfigDict, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class MALFORMEDREQUEST1(BaseModel):
26
- """
27
- MALFORMEDREQUEST1
28
- """ # noqa: E501
29
- message: Optional[StrictStr] = None
30
- code: Optional[StrictStr] = None
31
- __properties: ClassVar[List[str]] = ["message", "code"]
32
-
33
- model_config = ConfigDict(
34
- populate_by_name=True,
35
- validate_assignment=True,
36
- protected_namespaces=(),
37
- )
38
-
39
-
40
- def to_str(self) -> str:
41
- """Returns the string representation of the model using alias"""
42
- return pprint.pformat(self.model_dump(by_alias=True))
43
-
44
- def to_json(self) -> str:
45
- """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of MALFORMEDREQUEST1 from a JSON string"""
52
- return cls.from_dict(json.loads(json_str))
53
-
54
- def to_dict(self) -> Dict[str, Any]:
55
- """Return the dictionary representation of the model using alias.
56
-
57
- This has the following differences from calling pydantic's
58
- `self.model_dump(by_alias=True)`:
59
-
60
- * `None` is only added to the output dict for nullable fields that
61
- were set at model initialization. Other fields with value `None`
62
- are ignored.
63
- """
64
- excluded_fields: Set[str] = set([
65
- ])
66
-
67
- _dict = self.model_dump(
68
- by_alias=True,
69
- exclude=excluded_fields,
70
- exclude_none=True,
71
- )
72
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of MALFORMEDREQUEST1 from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate({
84
- "message": obj.get("message"),
85
- "code": obj.get("code")
86
- })
87
- return _obj
88
-
89
-
@@ -1,89 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Opportify Insights API
5
-
6
- ## 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-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate 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-reference/email-insights) - [**IP Insights:**](/docs/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-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.
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
- import pprint
17
- import re # noqa: F401
18
- import json
19
-
20
- from pydantic import BaseModel, ConfigDict, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class NOTFOUND(BaseModel):
26
- """
27
- NOTFOUND
28
- """ # noqa: E501
29
- message: Optional[StrictStr] = None
30
- code: Optional[StrictStr] = None
31
- __properties: ClassVar[List[str]] = ["message", "code"]
32
-
33
- model_config = ConfigDict(
34
- populate_by_name=True,
35
- validate_assignment=True,
36
- protected_namespaces=(),
37
- )
38
-
39
-
40
- def to_str(self) -> str:
41
- """Returns the string representation of the model using alias"""
42
- return pprint.pformat(self.model_dump(by_alias=True))
43
-
44
- def to_json(self) -> str:
45
- """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of NOTFOUND from a JSON string"""
52
- return cls.from_dict(json.loads(json_str))
53
-
54
- def to_dict(self) -> Dict[str, Any]:
55
- """Return the dictionary representation of the model using alias.
56
-
57
- This has the following differences from calling pydantic's
58
- `self.model_dump(by_alias=True)`:
59
-
60
- * `None` is only added to the output dict for nullable fields that
61
- were set at model initialization. Other fields with value `None`
62
- are ignored.
63
- """
64
- excluded_fields: Set[str] = set([
65
- ])
66
-
67
- _dict = self.model_dump(
68
- by_alias=True,
69
- exclude=excluded_fields,
70
- exclude_none=True,
71
- )
72
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of NOTFOUND from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate({
84
- "message": obj.get("message"),
85
- "code": obj.get("code")
86
- })
87
- return _obj
88
-
89
-
@@ -1,89 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Opportify Insights API
5
-
6
- ## 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-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate 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-reference/email-insights) - [**IP Insights:**](/docs/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-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.
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
- import pprint
17
- import re # noqa: F401
18
- import json
19
-
20
- from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class RiskReport(BaseModel):
26
- """
27
- ### Risk Level Determination This documentation outlines how the risk level is determined based on a `normalizedScore` generated by a **multivariate linear regression model**. The risk level provides a static representation of thresholds to classify the severity of risk for an entity. --- > **IMPORTANT:** > The risk report model is not available in the free plan. To access this feature, you need to subscribe to a paid plan. --- #### How the Score is Generated The risk score (`normalizedScore`) is computed using a **multivariate linear regression model**, a machine learning approach that evaluates multiple input features to predict the risk score. ##### Key Features of the Model: 1. **Dynamic Scoring:** The model assigns weights to various risk factors, dynamically updating them based on training with new data. 2. **Constant Training:** The model is continuously retrained with the latest data to improve accuracy and adapt to evolving risk patterns. 3. **Scalability:** The model supports multiple features and their interactions, deriving a comprehensive and reliable risk score. The output score is normalized to a range of **200–1000** for easier interpretation and alignment with industry practices. --- #### Risk Level Thresholds The risk level is a static representation of the `normalizedScore`, categorized into five distinct levels: | **Risk Level** | **Score Range** | **Description** | |----------------|--------------------------|---------------------------------------------------------------------------------| | `highest` | `normalizedScore > 800` | Represents the most critical level of risk. Immediate attention is required. | | `high` | `600 < normalizedScore <= 800` | Indicates a high level of risk. Consider mitigation actions promptly. | | `medium` | `400 < normalizedScore <= 600` | Reflects a moderate level of risk. Monitoring and possible action advised. | | `low` | `300 < normalizedScore <= 400` | Denotes a low level of risk. Regular monitoring is sufficient. | | `lowest` | `normalizedScore <= 300` | The lowest level of risk. Risk is considered negligible or minimal. | --- #### Usage This risk level determination serves as a human-readable representation of the machine learning model's output. It enables: - **Risk Monitoring:** Identifying entities that require immediate attention. - **Action Prioritization:** Guiding mitigation efforts based on the severity of the risk. - **Decision-Making:** Providing clear thresholds for automated and manual workflows. --- #### Key Notes 1. **Dynamic Scoring, Static Levels:** - While the score is dynamically updated through a multivariate linear regression model, the risk levels remain static to maintain consistency and interpretability. 2. **Customizable Thresholds:** - The thresholds for the levels are configurable based on organizational needs or domain-specific requirements. 3. **Model Retraining:** - Regular updates to the model ensure that scores accurately reflect real-world risk trends, improving the reliability of level assignments. --- This approach combines the adaptability of multivariate linear regression with the simplicity of static thresholds, offering a robust framework for risk assessment and decision-making. --- ### Response Elements
28
- """ # noqa: E501
29
- score: Optional[StrictInt] = Field(default=None, description="Risk score normalized to a range of 200–1000.")
30
- level: Optional[StrictStr] = Field(default=None, description="Static representation of the risk level.")
31
- __properties: ClassVar[List[str]] = ["score", "level"]
32
-
33
- model_config = ConfigDict(
34
- populate_by_name=True,
35
- validate_assignment=True,
36
- protected_namespaces=(),
37
- )
38
-
39
-
40
- def to_str(self) -> str:
41
- """Returns the string representation of the model using alias"""
42
- return pprint.pformat(self.model_dump(by_alias=True))
43
-
44
- def to_json(self) -> str:
45
- """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of RiskReport from a JSON string"""
52
- return cls.from_dict(json.loads(json_str))
53
-
54
- def to_dict(self) -> Dict[str, Any]:
55
- """Return the dictionary representation of the model using alias.
56
-
57
- This has the following differences from calling pydantic's
58
- `self.model_dump(by_alias=True)`:
59
-
60
- * `None` is only added to the output dict for nullable fields that
61
- were set at model initialization. Other fields with value `None`
62
- are ignored.
63
- """
64
- excluded_fields: Set[str] = set([
65
- ])
66
-
67
- _dict = self.model_dump(
68
- by_alias=True,
69
- exclude=excluded_fields,
70
- exclude_none=True,
71
- )
72
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of RiskReport from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate({
84
- "score": obj.get("score"),
85
- "level": obj.get("level")
86
- })
87
- return _obj
88
-
89
-
@@ -1,108 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: opportify_sdk
3
- Version: 0.1.1
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
-
15
- # Opportify-SDK-Python
16
-
17
- ## Overview
18
-
19
- 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.
20
-
21
- [Sign Up Free](https://www.opportify.ai)
22
-
23
- ### Base URL
24
- Use the following base URL for all API requests:
25
-
26
- ```plaintext
27
- https://api.opportify.ai/insights/v1/<service>/<endpoint>
28
- ```
29
-
30
- ## Requirements
31
-
32
- Requires Python v3.8 or later
33
-
34
- ## Getting Started
35
-
36
- First, install Opportify SDK via PyPI manager:
37
-
38
- ```
39
- pip install opportify-sdk
40
- ```
41
-
42
- ### Calling Email Insights
43
-
44
- ```python
45
- from opportify_sdk import EmailInsights
46
-
47
- # Initialize the wrapper with your API key
48
- api_key = "<YOUR-API-KEY-HERE>"
49
- email_insights = EmailInsights(api_key)
50
-
51
- # Optional: Configure host, version, and debug mode
52
- email_insights.set_version("v1")
53
-
54
- # Define request parameters
55
- params = {
56
- "email": "<SOME-EMAIL-HERE>",
57
- "enableAutoCorrection": True,
58
- "enableAi": True
59
- }
60
-
61
- # Call the API
62
- try:
63
- result = email_insights.analyze(params)
64
- print("Response:", result)
65
- except Exception as e:
66
- print(f"Error: {e}")
67
- ```
68
-
69
- ### Calling IP Insights
70
-
71
- ```python
72
-
73
- from opportify_sdk import IpInsights
74
-
75
- # Initialize the wrapper with your API key
76
- api_key = "<YOUR-API-KEY-HERE>"
77
- ip_insights = IpInsights(api_key)
78
-
79
- # Optional: Configure host, version, and debug mode
80
- ip_insights.set_version("v1")
81
-
82
- # Define request parameters
83
- params = {
84
- "ip": "<SOME-IP-HERE>",
85
- "enableAi": True
86
- }
87
-
88
- # Call the API
89
- try:
90
- result = ip_insights.analyze(params)
91
- print("Response:", result)
92
- except Exception as e:
93
- print(f"Error: {e}")
94
- ```
95
-
96
- ### Enable Debug Mode
97
-
98
- ```python
99
- ip_insights.set_version("v1").set_debug_mode(True)
100
- email_insights.set_version("v1").set_debug_mode(False)
101
- ```
102
-
103
- ## About this package
104
-
105
- This Python package is a customization of the base generated by:
106
-
107
- - [OpenAPI Generator](https://openapi-generator.tech) project.
108
-
@@ -1,49 +0,0 @@
1
- lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- lib/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- lib/v1/openapi_client/__init__.py,sha256=4YbyZsJjF4Ig1mWXt6fxS7uhdr0uDEQPZQ-xsbDIwDI,5986
4
- lib/v1/openapi_client/api_client.py,sha256=v_S3upItmHMMZXNSWYBtFIy2SSjt_MLAOcXpMiBST8g,30433
5
- lib/v1/openapi_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
6
- lib/v1/openapi_client/configuration.py,sha256=8U7Zd4rziMXTXvviDquxlSdDgSuSmsttGYeGDNOkod0,21544
7
- lib/v1/openapi_client/exceptions.py,sha256=tHCC6Ij9c8ScVmZyCL5thgYXpopuUG1NSpILlHI_-Sg,8938
8
- lib/v1/openapi_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- lib/v1/openapi_client/rest.py,sha256=QwKi4N39ZgYVtBPrXQzw8bkhpiZbfUUPuWhi44tMst0,12378
10
- lib/v1/openapi_client/api/__init__.py,sha256=_2MpmNT7so7K9CyzP-_2Sd_1EU8-Gq10jtUKccY86-Q,176
11
- lib/v1/openapi_client/api/email_insights_api.py,sha256=bbstLmF0CoBah5qxImN--ic1lBD1uMZ7jr0-ZpWUoAc,20667
12
- lib/v1/openapi_client/api/ip_insights_api.py,sha256=oCmkRBxVMaVBzrBsA6BoumRl7PvhlyMJla-xYPHMxww,21817
13
- lib/v1/openapi_client/models/__init__.py,sha256=9VT3hqjFqoCePDx2FhQ2qHjG4dIUbzc8VkBWgsrPtyc,5314
14
- lib/v1/openapi_client/models/abuse_contact.py,sha256=MqF8oUU6hxU4vLXlC6ykcpJiZhjRw6EiJDfeDWYCBxQ,6560
15
- lib/v1/openapi_client/models/admin_contact.py,sha256=HOmd_CnYyKtOPR-mGL3hbMZ8E5_TKlBlFgMVZOvfGH8,6560
16
- lib/v1/openapi_client/models/analyze_email200_response.py,sha256=0YCuUfjKTB_J7FPCHeiPDG-bK5NMf-U-qFvGtQG6h-c,8043
17
- lib/v1/openapi_client/models/analyze_email400_response.py,sha256=BrhikNZYFE0L1SScOlmZKh1CQNsOWi8m8e1fOzG9nus,5843
18
- lib/v1/openapi_client/models/analyze_email400_response_error.py,sha256=oxfixZuiMnwbqRwdDzO7q4MKhQgVyFwxjOKdXpVLc_E,8391
19
- lib/v1/openapi_client/models/analyze_email500_response.py,sha256=gAKw0QyVwBZdr52qCrSbRA8kdtBcIn-oW83hvK411j0,5843
20
- lib/v1/openapi_client/models/analyze_email500_response_error.py,sha256=LuKvELP551F70uAKOnQ_0eVI9fK1V5RLdksgCMtTEwA,5615
21
- lib/v1/openapi_client/models/analyze_email_request.py,sha256=yzu8AV6wBKWhbBUO7GtsCuKgX_KYJAg9c8bIWjMPJc4,6063
22
- lib/v1/openapi_client/models/analyze_ip200_response.py,sha256=_8uU_YPLrwTc-Mth3keN7TlWkm7jCiIYi2i1UHzWySk,9143
23
- lib/v1/openapi_client/models/analyze_ip400_response.py,sha256=aLPWgDU-QbKLzTD1KzHna3VURVRfqwP5m8WM4GINZPM,5819
24
- lib/v1/openapi_client/models/analyze_ip400_response_error.py,sha256=X2wjsiTtaSWmC-zeKYgwtlQ-N_onhB3Fv2pvFhsOWmg,8486
25
- lib/v1/openapi_client/models/analyze_ip404_response.py,sha256=mzS98l1DlVKFCFaOmhBc9XjUA7DdGJSXDBmFuL8Yjyk,5748
26
- lib/v1/openapi_client/models/analyze_ip500_response.py,sha256=FPgWlfRyaFWGNk4xmh6UBiG_Xiys-i7IMZOWu2HoCY8,5768
27
- lib/v1/openapi_client/models/analyze_ip_request.py,sha256=SZHr8Gd0mRrziip0VH5bgPZu84JCXGKjTSOzO8iSczc,5741
28
- lib/v1/openapi_client/models/asn.py,sha256=_PtsmGJCAogM2DryLp5SuIgKZ_5H4zkLQvBcYV8-F90,6237
29
- lib/v1/openapi_client/models/block_listed.py,sha256=UK0LxB8cPQzr6RP18p1GfLiLyVNJqPdYYrJyuhQiwdU,6815
30
- lib/v1/openapi_client/models/email_dns.py,sha256=0Ttu0-pEQke0lnwkA4Tq8ZKvED6nRn6abSGkPqVEa24,5546
31
- lib/v1/openapi_client/models/geo.py,sha256=GtTV2s0pDguxBBCbkViNidTmFmRsxfMqMwbb0IWnYkQ,9879
32
- lib/v1/openapi_client/models/internalerror.py,sha256=_LhOiY2kPKsN_WDU7tVuY65A9-mNiamedWqJddWKRZQ,5555
33
- lib/v1/openapi_client/models/invalidemail.py,sha256=-ofiTmHw2O61p_hzzELf_wpa9zgi5FjV_Kc-duJFY-o,5551
34
- lib/v1/openapi_client/models/ipvalidationfailed.py,sha256=Clmw3EqB48h6mfhUzNnWvgO5IzfLq03pMbtWfzxD8xo,5575
35
- lib/v1/openapi_client/models/malformedrequest.py,sha256=gaOr0Bh_d_Fy0gstnQzurGUD6JAF_kk2fi7Y7PnitB0,5567
36
- lib/v1/openapi_client/models/malformedrequest1.py,sha256=PZ1e26zin5yhpjwnsuht8XNIHweURLb3n1NwR8rTvV8,5571
37
- lib/v1/openapi_client/models/notfound.py,sha256=HifW-VdCOp0mn5RQdeM6QVQR1kZc5PlENAik0b9SGDo,5535
38
- lib/v1/openapi_client/models/organization.py,sha256=IcJr7vJXyKwE9VjlWwJh1PeRar3_gQ4sNkvniMSLQzk,7130
39
- lib/v1/openapi_client/models/risk_report.py,sha256=ANg1NOURvS-2mXbU8lNHgAlTNuNUYw4NkF43TR5ujsc,9132
40
- lib/v1/openapi_client/models/tech_contact.py,sha256=AF9myIFacYEMknGN_gGrqjRn8_mpiI7Y_fGhp1wHWpE,6549
41
- lib/v1/openapi_client/models/trusted_provider.py,sha256=DI33v3eTc6fUhx5NqbjOE7ZpA2VcKbNLSV5MWqodGB0,6174
42
- lib/v1/openapi_client/models/whois.py,sha256=Yoo9QsUHPMjo9nwSR_H8ZHMhP2fYNRug3jBk3Do6vcw,8833
43
- src/__init__.py,sha256=b5dO5TZ0ac8L7meGstmpAzIWXS9jwPqV1EruY32dffk,139
44
- src/email_insights.py,sha256=i4NaYLZiJfXeHaNRZz3V15q8nsgGMcC37iBG5AaDj-Q,3283
45
- src/ip_insights.py,sha256=yaydXslmi5e_cSFCniJTFCWazE1Zw4K-ZlXiLxGbfkU,3008
46
- opportify_sdk-0.1.1.dist-info/METADATA,sha256=6bRgIBmdzuGi30ooeYSN51obEPgcVW-etXYZI7SwV8o,2459
47
- opportify_sdk-0.1.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
48
- opportify_sdk-0.1.1.dist-info/top_level.txt,sha256=4zVviOxxwoucHwO4Z7OzyNBMPn7vZjaTdyfvDO-OZfg,8
49
- opportify_sdk-0.1.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- lib
2
- src
src/email_insights.py DELETED
@@ -1,97 +0,0 @@
1
- # src/email_insights.py
2
- import openapi_client
3
- from openapi_client.configuration import Configuration as ApiConfiguration
4
- from openapi_client.api_client import ApiClient
5
- from openapi_client.api.email_insights_api import EmailInsightsApi
6
- from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
7
- from openapi_client.exceptions import ApiException
8
-
9
- class EmailInsights:
10
- def __init__(self, api_key: str):
11
- """
12
- Initialize the EmailInsights class with the provided API key.
13
-
14
- :param api_key: The API key for authentication.
15
- """
16
- self.config = ApiConfiguration()
17
- self.config.api_key = {"opportifyToken": api_key}
18
- self.host = "https://api.opportify.ai"
19
- self.version = "v1"
20
- self.debug_mode = False
21
- self.api_instance = None
22
-
23
- def analyze(self, params: dict) -> dict:
24
- """
25
- Analyze the email with the given parameters.
26
-
27
- :param params: Dictionary containing parameters for email analysis.
28
- :return: The analysis result as a dictionary.
29
- :raises Exception: If an API exception occurs.
30
- """
31
- params = self._normalize_request(params)
32
-
33
- # Configure the host and create the API client instance
34
- self.config.host = f"{self.host}/insights/{self.version}"
35
- api_client = ApiClient(configuration=self.config)
36
- api_client.configuration.debug = self.debug_mode
37
- self.api_instance = EmailInsightsApi(api_client)
38
-
39
- # Prepare the AnalyzeEmailRequest object
40
- analyze_email_request = AnalyzeEmailRequest(**params)
41
-
42
- try:
43
- result = self.api_instance.analyze_email(analyze_email_request)
44
- return result.to_dict()
45
- except ApiException as e:
46
- raise Exception(f"API exception: {e.reason}")
47
-
48
- def set_host(self, host: str) -> "EmailInsights":
49
- """
50
- Set the host.
51
-
52
- :param host: The host URL.
53
- :return: The current instance for chaining.
54
- """
55
- self.host = host
56
- return self
57
-
58
- def set_version(self, version: str) -> "EmailInsights":
59
- """
60
- Set the version.
61
-
62
- :param version: The API version.
63
- :return: The current instance for chaining.
64
- """
65
- self.version = version
66
- return self
67
-
68
- def set_debug_mode(self, debug_mode: bool) -> "EmailInsights":
69
- """
70
- Set the debug mode.
71
-
72
- :param debug_mode: Enable or disable debug mode.
73
- :return: The current instance for chaining.
74
- """
75
- self.debug_mode = debug_mode
76
- return self
77
-
78
- def _normalize_request(self, params: dict) -> dict:
79
- """
80
- Normalize the request parameters.
81
-
82
- :param params: The raw parameters.
83
- :return: Normalized parameters.
84
- """
85
- normalized = {}
86
- normalized["email"] = str(params["email"])
87
-
88
- if "enableAi" in params:
89
- params["enable_ai"] = params.pop("enableAi")
90
-
91
- if "enableAutoCorrection" in params:
92
- params["enable_auto_correction"] = bool(params.pop("enableAutoCorrection"))
93
-
94
- normalized["enable_ai"] = bool(params.get("enable_ai", False))
95
- normalized["enable_auto_correction"] = bool(params.get("enable_auto_correction", False))
96
-
97
- return normalized
src/ip_insights.py DELETED
@@ -1,93 +0,0 @@
1
- # src/ip_insights.py
2
- import openapi_client
3
- from openapi_client.configuration import Configuration as ApiConfiguration
4
- from openapi_client.api_client import ApiClient
5
- from openapi_client.api.ip_insights_api import IPInsightsApi
6
- from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
7
- from openapi_client.exceptions import ApiException
8
-
9
- class IpInsights:
10
- def __init__(self, api_key: str):
11
- """
12
- Initialize the IpInsights class with the provided API key.
13
-
14
- :param api_key: The API key for authentication.
15
- """
16
- self.config = ApiConfiguration()
17
- self.config.api_key = {"opportifyToken": api_key}
18
- self.host = "https://api.opportify.com"
19
- self.version = "v1"
20
- self.debug_mode = False
21
- self.api_instance = None
22
-
23
- def analyze(self, params: dict) -> dict:
24
- """
25
- Analyze the IP address based on the provided parameters.
26
-
27
- :param params: Dictionary containing parameters for IP analysis.
28
- :return: The analysis result as a dictionary.
29
- :raises Exception: If an API exception occurs.
30
- """
31
- params = self._normalize_request(params)
32
-
33
- # Configure the host and create the API client instance
34
- self.config.host = f"{self.host}/insights/{self.version}"
35
- api_client = ApiClient(configuration=self.config)
36
- api_client.configuration.debug = self.debug_mode
37
- self.api_instance = IPInsightsApi(api_client)
38
-
39
- # Prepare the AnalyzeIpRequest object
40
- analyze_ip_request = AnalyzeIpRequest(**params)
41
-
42
- try:
43
- result = self.api_instance.analyze_ip(analyze_ip_request)
44
- return result.to_dict()
45
- except ApiException as e:
46
- raise Exception(f"API exception: {e.reason}")
47
-
48
- def set_host(self, host: str) -> "IpInsights":
49
- """
50
- Set the host.
51
-
52
- :param host: The host URL.
53
- :return: The current instance for chaining.
54
- """
55
- self.host = host
56
- return self
57
-
58
- def set_version(self, version: str) -> "IpInsights":
59
- """
60
- Set the version.
61
-
62
- :param version: The API version.
63
- :return: The current instance for chaining.
64
- """
65
- self.version = version
66
- return self
67
-
68
- def set_debug_mode(self, debug_mode: bool) -> "IpInsights":
69
- """
70
- Set the debug mode.
71
-
72
- :param debug_mode: Enable or disable debug mode.
73
- :return: The current instance for chaining.
74
- """
75
- self.debug_mode = debug_mode
76
- return self
77
-
78
- def _normalize_request(self, params: dict) -> dict:
79
- """
80
- Normalize the request parameters.
81
-
82
- :param params: The raw parameters.
83
- :return: Normalized parameters.
84
- """
85
- normalized = {}
86
- normalized["ip"] = str(params["ip"])
87
-
88
- if "enableAi" in params:
89
- params["enable_ai"] = params.pop("enableAi")
90
-
91
- normalized["enable_ai"] = bool(params.get("enable_ai", False))
92
-
93
- return normalized
File without changes
File without changes