fiftyone-ipintelligence 4.5.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.
- fiftyone_ipintelligence-4.5.0/MANIFEST.in +2 -0
- fiftyone_ipintelligence-4.5.0/PKG-INFO +71 -0
- fiftyone_ipintelligence-4.5.0/pyproject.toml +3 -0
- fiftyone_ipintelligence-4.5.0/readme.md +36 -0
- fiftyone_ipintelligence-4.5.0/setup.cfg +4 -0
- fiftyone_ipintelligence-4.5.0/setup.py +70 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence/__init__.py +0 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence/ipintelligence_pipelinebuilder.py +134 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence.egg-info/PKG-INFO +71 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence.egg-info/SOURCES.txt +12 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence.egg-info/dependency_links.txt +1 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence.egg-info/requires.txt +3 -0
- fiftyone_ipintelligence-4.5.0/src/fiftyone_ipintelligence.egg-info/top_level.txt +1 -0
- fiftyone_ipintelligence-4.5.0/version.txt +1 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fiftyone_ipintelligence
|
|
3
|
+
Version: 4.5.0
|
|
4
|
+
Summary: 51Degrees IP Intelligence resolves an IP address to detailed location, network and registration information. This package aggregates the cloud and on-premise IP intelligence engines for the 51Degrees Pipeline API.
|
|
5
|
+
Home-page: https://51degrees.com/?utm_source=pypi&utm_medium=package&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-setup.py&utm_term=url
|
|
6
|
+
Author: 51Degrees Engineering
|
|
7
|
+
Author-email: engineering@51degrees.com
|
|
8
|
+
License: EUPL-1.2
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: fiftyone_ipintelligence_shared
|
|
23
|
+
Requires-Dist: fiftyone_ipintelligence_cloud
|
|
24
|
+
Requires-Dist: fiftyone_ipintelligence_onpremise
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: requires-dist
|
|
33
|
+
Dynamic: requires-python
|
|
34
|
+
Dynamic: summary
|
|
35
|
+
|
|
36
|
+
# 51Degrees IP Intelligence Engines
|
|
37
|
+
|
|
38
|
+
 **Python IP Intelligence**
|
|
39
|
+
|
|
40
|
+
[Developer Documentation](https://51degrees.com/ip-intelligence-python/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-readme.md&utm_term=51degrees-ip-intelligence-engines "developer documentation")
|
|
41
|
+
|
|
42
|
+
## Introduction
|
|
43
|
+
|
|
44
|
+
This package aggregates the cloud and on-premise 51Degrees IP intelligence
|
|
45
|
+
engines for the [51Degrees Pipeline API](https://51degrees.com/documentation/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-readme.md&utm_term=introduction)
|
|
46
|
+
and provides the `IpIntelligencePipelineBuilder` which builds a pipeline with
|
|
47
|
+
either engine depending on the settings provided:
|
|
48
|
+
|
|
49
|
+
- Provide a `resource_key` to use the cloud engine.
|
|
50
|
+
- Provide a `data_file_path` pointing at a `.ipi` data file to use the
|
|
51
|
+
on-premise engine.
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from fiftyone_ipintelligence.ipintelligence_pipelinebuilder import IpIntelligencePipelineBuilder
|
|
57
|
+
|
|
58
|
+
# Cloud
|
|
59
|
+
pipeline = IpIntelligencePipelineBuilder(resource_key="YOUR_RESOURCE_KEY").build()
|
|
60
|
+
|
|
61
|
+
# On-premise
|
|
62
|
+
pipeline = IpIntelligencePipelineBuilder(
|
|
63
|
+
data_file_path="51Degrees-LiteIpiV41.ipi",
|
|
64
|
+
licence_keys="",
|
|
65
|
+
usage_sharing=False).build()
|
|
66
|
+
|
|
67
|
+
flowdata = pipeline.create_flowdata()
|
|
68
|
+
flowdata.evidence.add("query.client-ip", "185.28.167.78")
|
|
69
|
+
flowdata.process()
|
|
70
|
+
print(flowdata.ip.registeredname.value())
|
|
71
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# 51Degrees IP Intelligence Engines
|
|
2
|
+
|
|
3
|
+
 **Python IP Intelligence**
|
|
4
|
+
|
|
5
|
+
[Developer Documentation](https://51degrees.com/ip-intelligence-python/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-readme.md&utm_term=51degrees-ip-intelligence-engines "developer documentation")
|
|
6
|
+
|
|
7
|
+
## Introduction
|
|
8
|
+
|
|
9
|
+
This package aggregates the cloud and on-premise 51Degrees IP intelligence
|
|
10
|
+
engines for the [51Degrees Pipeline API](https://51degrees.com/documentation/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-readme.md&utm_term=introduction)
|
|
11
|
+
and provides the `IpIntelligencePipelineBuilder` which builds a pipeline with
|
|
12
|
+
either engine depending on the settings provided:
|
|
13
|
+
|
|
14
|
+
- Provide a `resource_key` to use the cloud engine.
|
|
15
|
+
- Provide a `data_file_path` pointing at a `.ipi` data file to use the
|
|
16
|
+
on-premise engine.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from fiftyone_ipintelligence.ipintelligence_pipelinebuilder import IpIntelligencePipelineBuilder
|
|
22
|
+
|
|
23
|
+
# Cloud
|
|
24
|
+
pipeline = IpIntelligencePipelineBuilder(resource_key="YOUR_RESOURCE_KEY").build()
|
|
25
|
+
|
|
26
|
+
# On-premise
|
|
27
|
+
pipeline = IpIntelligencePipelineBuilder(
|
|
28
|
+
data_file_path="51Degrees-LiteIpiV41.ipi",
|
|
29
|
+
licence_keys="",
|
|
30
|
+
usage_sharing=False).build()
|
|
31
|
+
|
|
32
|
+
flowdata = pipeline.create_flowdata()
|
|
33
|
+
flowdata.evidence.add("query.client-ip", "185.28.167.78")
|
|
34
|
+
flowdata.process()
|
|
35
|
+
print(flowdata.ip.registeredname.value())
|
|
36
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# *********************************************************************
|
|
2
|
+
# This Original Work is copyright of 51 Degrees Mobile Experts Limited.
|
|
3
|
+
# Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
|
|
4
|
+
# Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
|
|
5
|
+
#
|
|
6
|
+
# This Original Work is licensed under the European Union Public Licence
|
|
7
|
+
# (EUPL) v.1.2 and is subject to its terms as set out below.
|
|
8
|
+
#
|
|
9
|
+
# If a copy of the EUPL was not distributed with this file, You can obtain
|
|
10
|
+
# one at https://opensource.org/licenses/EUPL-1.2.
|
|
11
|
+
#
|
|
12
|
+
# The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
|
|
13
|
+
# amended by the European Commission) shall be deemed incompatible for
|
|
14
|
+
# the purposes of the Work and the provisions of the compatibility
|
|
15
|
+
# clause in Article 5 of the EUPL shall not apply.
|
|
16
|
+
#
|
|
17
|
+
# If using the Work as, or as part of, a network application, by
|
|
18
|
+
# including the attribution notice(s) required under Article 5 of the EUPL
|
|
19
|
+
# in the end user terms of the application under an appropriate heading,
|
|
20
|
+
# such notice(s) shall fulfill the requirements of that article.
|
|
21
|
+
# *********************************************************************
|
|
22
|
+
|
|
23
|
+
import setuptools
|
|
24
|
+
import io
|
|
25
|
+
import os
|
|
26
|
+
|
|
27
|
+
def read(file_name):
|
|
28
|
+
|
|
29
|
+
"""Read a text file and return the content as a string."""
|
|
30
|
+
try:
|
|
31
|
+
with io.open(
|
|
32
|
+
os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8"
|
|
33
|
+
) as f:
|
|
34
|
+
return f.read().strip()
|
|
35
|
+
except:
|
|
36
|
+
return "0.0.0"
|
|
37
|
+
|
|
38
|
+
setuptools.setup(
|
|
39
|
+
name="fiftyone_ipintelligence",
|
|
40
|
+
version=read("version.txt"),
|
|
41
|
+
author="51Degrees Engineering",
|
|
42
|
+
author_email="engineering@51degrees.com",
|
|
43
|
+
url="https://51degrees.com/?utm_source=pypi&utm_medium=package&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-setup.py&utm_term=url",
|
|
44
|
+
description=("51Degrees IP Intelligence resolves an IP address to detailed location, network and registration information. This package aggregates the cloud and on-premise IP intelligence engines for the 51Degrees Pipeline API."),
|
|
45
|
+
long_description=read("readme.md"),
|
|
46
|
+
long_description_content_type='text/markdown',
|
|
47
|
+
python_requires=">=3.10",
|
|
48
|
+
packages=["fiftyone_ipintelligence"],
|
|
49
|
+
package_dir={"": "src"},
|
|
50
|
+
install_requires=[
|
|
51
|
+
"fiftyone_ipintelligence_shared",
|
|
52
|
+
"fiftyone_ipintelligence_cloud",
|
|
53
|
+
"fiftyone_ipintelligence_onpremise"
|
|
54
|
+
],
|
|
55
|
+
license="EUPL-1.2",
|
|
56
|
+
classifiers=[
|
|
57
|
+
"Development Status :: 5 - Production/Stable",
|
|
58
|
+
"Programming Language :: Python",
|
|
59
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
60
|
+
"Programming Language :: Python :: 3.10",
|
|
61
|
+
"Programming Language :: Python :: 3.11",
|
|
62
|
+
"Programming Language :: Python :: 3.12",
|
|
63
|
+
"Programming Language :: Python :: 3.13",
|
|
64
|
+
"Programming Language :: Python :: 3.14",
|
|
65
|
+
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)",
|
|
66
|
+
"Operating System :: OS Independent",
|
|
67
|
+
"Topic :: Software Development :: Libraries :: Python Modules"
|
|
68
|
+
],
|
|
69
|
+
include_package_data=True
|
|
70
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# *********************************************************************
|
|
2
|
+
# This Original Work is copyright of 51 Degrees Mobile Experts Limited.
|
|
3
|
+
# Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
|
|
4
|
+
# Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
|
|
5
|
+
#
|
|
6
|
+
# This Original Work is licensed under the European Union Public Licence
|
|
7
|
+
# (EUPL) v.1.2 and is subject to its terms as set out below.
|
|
8
|
+
#
|
|
9
|
+
# If a copy of the EUPL was not distributed with this file, You can obtain
|
|
10
|
+
# one at https://opensource.org/licenses/EUPL-1.2.
|
|
11
|
+
#
|
|
12
|
+
# The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
|
|
13
|
+
# amended by the European Commission) shall be deemed incompatible for
|
|
14
|
+
# the purposes of the Work and the provisions of the compatibility
|
|
15
|
+
# clause in Article 5 of the EUPL shall not apply.
|
|
16
|
+
#
|
|
17
|
+
# If using the Work as, or as part of, a network application, by
|
|
18
|
+
# including the attribution notice(s) required under Article 5 of the EUPL
|
|
19
|
+
# in the end user terms of the application under an appropriate heading,
|
|
20
|
+
# such notice(s) shall fulfill the requirements of that article.
|
|
21
|
+
# *********************************************************************
|
|
22
|
+
|
|
23
|
+
from fiftyone_pipeline_core.pipelinebuilder import PipelineBuilder
|
|
24
|
+
from fiftyone_pipeline_cloudrequestengine.cloudrequestengine import CloudRequestEngine
|
|
25
|
+
from fiftyone_ipintelligence_cloud.ipintelligence_cloud import IpIntelligenceCloud
|
|
26
|
+
from fiftyone_ipintelligence_onpremise.ipintelligence_onpremise import IpIntelligenceOnPremise
|
|
27
|
+
from fiftyone_ipintelligence_shared.utils import merge_two_dicts
|
|
28
|
+
|
|
29
|
+
from fiftyone_pipeline_engines_fiftyone.share_usage import ShareUsage
|
|
30
|
+
|
|
31
|
+
class IpIntelligencePipelineBuilder(PipelineBuilder):
|
|
32
|
+
"""!
|
|
33
|
+
The IP Intelligence Pipeline Builder allows you to easily
|
|
34
|
+
construct a pipeline containing either the cloud or on-premise
|
|
35
|
+
IP intelligence engine depending on the parameters supplied.
|
|
36
|
+
"""
|
|
37
|
+
def __init__(self, settings = None, usage_sharing = True, **kwargs):
|
|
38
|
+
|
|
39
|
+
"""!
|
|
40
|
+
|
|
41
|
+
Constructor for the IP Intelligence Pipeline Builder.
|
|
42
|
+
Depending on parameters passed through, builds a pipeline
|
|
43
|
+
with either the cloud or on premise IP intelligence engines
|
|
44
|
+
|
|
45
|
+
General pipeline settings:
|
|
46
|
+
|
|
47
|
+
@type javascript_builder_settings: dict
|
|
48
|
+
@param javascript_builder_settings: parameters for the pipeline's JavaScript builder to populate additional evidence from the clientside.
|
|
49
|
+
- obj_name: the name of the client side object
|
|
50
|
+
with the JavaScript properties in it ('fod' by default)
|
|
51
|
+
- protocol: The protocol ("http" or "https") used by
|
|
52
|
+
the client side callback url. This can be overridden
|
|
53
|
+
with header.protocol evidence
|
|
54
|
+
- host The host of the client side callback url.
|
|
55
|
+
This can be overridden with header.host evidence.
|
|
56
|
+
- endpoint The endpoint of the client side callback url
|
|
57
|
+
* enable_cookies - whether cookies should be enabled
|
|
58
|
+
* minify: Whether to minify the JavaScript
|
|
59
|
+
@type cache: Cache
|
|
60
|
+
@param cache: An instance of the fiftyone.pipeline.engines.cache, for the cloud engine only. The on-premise engine raises an exception if one is supplied
|
|
61
|
+
class
|
|
62
|
+
|
|
63
|
+
Cloud Engine Settings:
|
|
64
|
+
|
|
65
|
+
@type resource_key: string
|
|
66
|
+
@param resource_key: the 51Degrees cloud resource key
|
|
67
|
+
@type cloud_request_origin: string
|
|
68
|
+
@param cloud_request_origin: the value to use for the Origin header when making requests to the cloud service
|
|
69
|
+
|
|
70
|
+
On Premise Engine Settings:
|
|
71
|
+
|
|
72
|
+
@type usage_sharing : bool
|
|
73
|
+
@param usage_sharing : Whether to enable usage sharing if using the on premise engine
|
|
74
|
+
@type data_file_path: string
|
|
75
|
+
@param data_file_path: path to the data file (.ipi)
|
|
76
|
+
@type auto_update: bool
|
|
77
|
+
@param auto_update: whether to automatically update the datafile when required
|
|
78
|
+
@type restricted_properties: list
|
|
79
|
+
@param restricted_properties: List of property keys to limit the engine to
|
|
80
|
+
@type licence_keys: string
|
|
81
|
+
@param licence_keys: licencekeys to use for the data file update service
|
|
82
|
+
@type download: bool
|
|
83
|
+
@param download: whether to download the datafile or keep it in memory when it is returned from the datafile update service
|
|
84
|
+
@type performance_profile: string
|
|
85
|
+
@param performance_profile: options are: LowMemory, MaxPerformance, Balanced, BalancedTemp, HighPerformance
|
|
86
|
+
@type reuse_temp_file: bool
|
|
87
|
+
@param reuse_temp_file: Indicates that an existing temp file may be used. This should be selected if multiple instances wish to use the same file to prevent high disk usage.
|
|
88
|
+
@type concurrency: int
|
|
89
|
+
@param concurrency: defaults to the number of cpus in the machine
|
|
90
|
+
@type update_on_start : bool
|
|
91
|
+
@param update_on_start : When this is set to true the datafile is updated / downloaded immediately on initialisation. This is useful if no initial datafile is present.
|
|
92
|
+
@type file_system_watcher: bool
|
|
93
|
+
@param file_system_watcher: whether to check the datafile's path for changes and update the connected FlowElement's data
|
|
94
|
+
@type polling_interval: int
|
|
95
|
+
@param polling_interval: How often to poll for updates to the datafile (minutes)
|
|
96
|
+
@type update_time_maximum_randomisation : int
|
|
97
|
+
@param update_time_maximum_randomisation :
|
|
98
|
+
Maximum randomisation offset in seconds to polling time interval
|
|
99
|
+
@type create_temp_data_copy: bool
|
|
100
|
+
@param create_temp_data_copy: whether to copy datafile to temporary location when updating
|
|
101
|
+
@type data_update_url: string
|
|
102
|
+
@param data_update_url: base url for the datafile update service
|
|
103
|
+
|
|
104
|
+
"""
|
|
105
|
+
if settings is None:
|
|
106
|
+
settings = {}
|
|
107
|
+
|
|
108
|
+
settings = merge_two_dicts(dict(**kwargs), locals())
|
|
109
|
+
|
|
110
|
+
settings = merge_two_dicts(settings, settings["settings"])
|
|
111
|
+
|
|
112
|
+
del settings["self"]
|
|
113
|
+
|
|
114
|
+
super(IpIntelligencePipelineBuilder, self).__init__(settings)
|
|
115
|
+
|
|
116
|
+
# Add specific engines
|
|
117
|
+
|
|
118
|
+
if "data_file_path" in settings:
|
|
119
|
+
del settings["settings"]
|
|
120
|
+
ip_engine = IpIntelligenceOnPremise(**settings)
|
|
121
|
+
|
|
122
|
+
# If usage sharing enabled, add usage sharing engine
|
|
123
|
+
|
|
124
|
+
if usage_sharing:
|
|
125
|
+
self.add(ShareUsage())
|
|
126
|
+
|
|
127
|
+
else :
|
|
128
|
+
self.add(CloudRequestEngine(settings))
|
|
129
|
+
ip_engine = IpIntelligenceCloud()
|
|
130
|
+
|
|
131
|
+
if "cache" in settings:
|
|
132
|
+
ip_engine.set_cache(settings["cache"])
|
|
133
|
+
|
|
134
|
+
self.add(ip_engine)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fiftyone_ipintelligence
|
|
3
|
+
Version: 4.5.0
|
|
4
|
+
Summary: 51Degrees IP Intelligence resolves an IP address to detailed location, network and registration information. This package aggregates the cloud and on-premise IP intelligence engines for the 51Degrees Pipeline API.
|
|
5
|
+
Home-page: https://51degrees.com/?utm_source=pypi&utm_medium=package&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-setup.py&utm_term=url
|
|
6
|
+
Author: 51Degrees Engineering
|
|
7
|
+
Author-email: engineering@51degrees.com
|
|
8
|
+
License: EUPL-1.2
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: fiftyone_ipintelligence_shared
|
|
23
|
+
Requires-Dist: fiftyone_ipintelligence_cloud
|
|
24
|
+
Requires-Dist: fiftyone_ipintelligence_onpremise
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: requires-dist
|
|
33
|
+
Dynamic: requires-python
|
|
34
|
+
Dynamic: summary
|
|
35
|
+
|
|
36
|
+
# 51Degrees IP Intelligence Engines
|
|
37
|
+
|
|
38
|
+
 **Python IP Intelligence**
|
|
39
|
+
|
|
40
|
+
[Developer Documentation](https://51degrees.com/ip-intelligence-python/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-readme.md&utm_term=51degrees-ip-intelligence-engines "developer documentation")
|
|
41
|
+
|
|
42
|
+
## Introduction
|
|
43
|
+
|
|
44
|
+
This package aggregates the cloud and on-premise 51Degrees IP intelligence
|
|
45
|
+
engines for the [51Degrees Pipeline API](https://51degrees.com/documentation/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence-readme.md&utm_term=introduction)
|
|
46
|
+
and provides the `IpIntelligencePipelineBuilder` which builds a pipeline with
|
|
47
|
+
either engine depending on the settings provided:
|
|
48
|
+
|
|
49
|
+
- Provide a `resource_key` to use the cloud engine.
|
|
50
|
+
- Provide a `data_file_path` pointing at a `.ipi` data file to use the
|
|
51
|
+
on-premise engine.
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from fiftyone_ipintelligence.ipintelligence_pipelinebuilder import IpIntelligencePipelineBuilder
|
|
57
|
+
|
|
58
|
+
# Cloud
|
|
59
|
+
pipeline = IpIntelligencePipelineBuilder(resource_key="YOUR_RESOURCE_KEY").build()
|
|
60
|
+
|
|
61
|
+
# On-premise
|
|
62
|
+
pipeline = IpIntelligencePipelineBuilder(
|
|
63
|
+
data_file_path="51Degrees-LiteIpiV41.ipi",
|
|
64
|
+
licence_keys="",
|
|
65
|
+
usage_sharing=False).build()
|
|
66
|
+
|
|
67
|
+
flowdata = pipeline.create_flowdata()
|
|
68
|
+
flowdata.evidence.add("query.client-ip", "185.28.167.78")
|
|
69
|
+
flowdata.process()
|
|
70
|
+
print(flowdata.ip.registeredname.value())
|
|
71
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
pyproject.toml
|
|
3
|
+
readme.md
|
|
4
|
+
setup.py
|
|
5
|
+
version.txt
|
|
6
|
+
src/fiftyone_ipintelligence/__init__.py
|
|
7
|
+
src/fiftyone_ipintelligence/ipintelligence_pipelinebuilder.py
|
|
8
|
+
src/fiftyone_ipintelligence.egg-info/PKG-INFO
|
|
9
|
+
src/fiftyone_ipintelligence.egg-info/SOURCES.txt
|
|
10
|
+
src/fiftyone_ipintelligence.egg-info/dependency_links.txt
|
|
11
|
+
src/fiftyone_ipintelligence.egg-info/requires.txt
|
|
12
|
+
src/fiftyone_ipintelligence.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fiftyone_ipintelligence
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.5.0
|