ipulse-shared-core-ftredge 2.6__tar.gz → 2.6.1__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 ipulse-shared-core-ftredge might be problematic. Click here for more details.
- ipulse_shared_core_ftredge-2.6.1/PKG-INFO +13 -0
- ipulse_shared_core_ftredge-2.6.1/README.md +21 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/setup.py +6 -2
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/__init__.py +22 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/__init__.py +32 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/enums_cloud.py +17 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/enums_common_utils.py +98 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/enums_data_eng.py +109 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/enums_logs.py +79 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/enums_module_fincore.py +58 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums/enums_modules.py +25 -0
- {ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/models → ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/enums}/pulse_enums.py +10 -46
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/src/ipulse_shared_core_ftredge/models/__init__.py +0 -1
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/models/organisation.py +71 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/models/resource_catalog_item.py +115 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/src/ipulse_shared_core_ftredge/models/user_profile.py +10 -9
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/models/user_profile_update.py +36 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/src/ipulse_shared_core_ftredge/models/user_status.py +21 -11
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/__init__.py +19 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/logs/__init__.py +2 -0
- {ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/models → ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/logs}/audit_log_firestore.py +1 -1
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/logs/context_log.py +211 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/logs/get_logger.py +76 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_cloud.py +44 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_cloud_gcp.py +311 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_cloud_gcp_with_collectors.py +169 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_cloud_with_collectors.py +26 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_collector_pipelinemon.py +356 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_common.py +145 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge/utils/utils_templates_and_schemas.py +151 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge.egg-info/PKG-INFO +13 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge.egg-info/SOURCES.txt +38 -0
- ipulse_shared_core_ftredge-2.6.1/src/ipulse_shared_core_ftredge.egg-info/requires.txt +6 -0
- ipulse_shared_core_ftredge-2.6.1/tests/test_utils_gcp.py +189 -0
- ipulse_shared_core_ftredge-2.6/PKG-INFO +0 -10
- ipulse_shared_core_ftredge-2.6/README.md +0 -2
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/__init__.py +0 -5
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/models/organisation.py +0 -65
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/models/resource_catalog_item.py +0 -189
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/models/user_profile_update.py +0 -18
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/tests/__init__.py +0 -0
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge/tests/test.py +0 -17
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge.egg-info/PKG-INFO +0 -10
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge.egg-info/SOURCES.txt +0 -21
- ipulse_shared_core_ftredge-2.6/src/ipulse_shared_core_ftredge.egg-info/requires.txt +0 -3
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/LICENCE +0 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/pyproject.toml +0 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/setup.cfg +0 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/src/ipulse_shared_core_ftredge/models/user_auth.py +0 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/src/ipulse_shared_core_ftredge.egg-info/dependency_links.txt +0 -0
- {ipulse_shared_core_ftredge-2.6 → ipulse_shared_core_ftredge-2.6.1}/src/ipulse_shared_core_ftredge.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ipulse_shared_core_ftredge
|
|
3
|
+
Version: 2.6.1
|
|
4
|
+
Summary: Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.
|
|
5
|
+
Home-page: https://github.com/TheFutureEdge/ipulse_shared_core
|
|
6
|
+
Author: Russlan Ramdowar
|
|
7
|
+
License-File: LICENCE
|
|
8
|
+
Requires-Dist: pydantic[email]~=2.5
|
|
9
|
+
Requires-Dist: python-dateutil~=2.8
|
|
10
|
+
Requires-Dist: pytest~=7.1
|
|
11
|
+
Requires-Dist: google-cloud-logging~=3.10.0
|
|
12
|
+
Requires-Dist: google-cloud-error-reporting~=1.11.0
|
|
13
|
+
Requires-Dist: google-cloud-bigquery~=3.24.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ipulse_shared_core
|
|
2
|
+
Shared Models like User, Organisation etc. Also includes shared enum_sets
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Enums
|
|
6
|
+
|
|
7
|
+
Contains majority of all Enums used in Pulse
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Collectors i.e. Pipelinemon
|
|
12
|
+
|
|
13
|
+
Collectors are smart Objects which are added to long running functions or pipelines for which we want to collect an overall number of successes, notices, warnings or errors.
|
|
14
|
+
|
|
15
|
+
We can wait until the full pipeline is finished in order to write off a single Summary file from a Collector, or we can attach to it a logger, which will be reporting major status along the journey, which is often times better. Because if a function crashes midway through , all logs will be lost, and it would be hard to investigate if anythign has bee persisted and has to be rolled back. THis will require a lot of manual effort to recollect.
|
|
16
|
+
|
|
17
|
+
Pipelinemon , short of Pipeline Monitoring system is a type of very powerful Collector which Russlan created specifically for Pulse Data Engineering pipelines.
|
|
18
|
+
|
|
19
|
+
Pipelinemon writes all observation logs to Google CLoud Logging, and you have to setup a Log Sink (Router) which will send the Pipelinemon's observation logs to BigQuery.
|
|
20
|
+
|
|
21
|
+
Great thing about Pipelinemin is its "context" keeping feature.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
# pylint: disable=import-error
|
|
1
2
|
from setuptools import setup, find_packages
|
|
2
3
|
|
|
3
4
|
setup(
|
|
4
5
|
name='ipulse_shared_core_ftredge',
|
|
5
|
-
version='2.6',
|
|
6
|
+
version='2.6.1',
|
|
6
7
|
package_dir={'': 'src'}, # Specify the source directory
|
|
7
8
|
packages=find_packages(where='src'), # Look for packages in 'src'
|
|
8
9
|
install_requires=[
|
|
@@ -10,8 +11,11 @@ setup(
|
|
|
10
11
|
'pydantic[email]~=2.5',
|
|
11
12
|
'python-dateutil~=2.8',
|
|
12
13
|
'pytest~=7.1',
|
|
14
|
+
'google-cloud-logging~=3.10.0',
|
|
15
|
+
'google-cloud-error-reporting~=1.11.0',
|
|
16
|
+
'google-cloud-bigquery~=3.24.0'
|
|
13
17
|
],
|
|
14
18
|
author='Russlan Ramdowar',
|
|
15
|
-
description='Shared models for the Pulse platform project. Using AI for financial advisory and investment management.',
|
|
19
|
+
description='Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.',
|
|
16
20
|
url='https://github.com/TheFutureEdge/ipulse_shared_core',
|
|
17
21
|
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
from .models import ( UserAuth, UserProfile,
|
|
3
|
+
UserStatus, UserProfileUpdate)
|
|
4
|
+
|
|
5
|
+
from .enums import (TargetLogs,LogLevel, Status, Unit, Frequency,
|
|
6
|
+
Module, Domain, FinCoreCategory, FincCoreSubCategory,
|
|
7
|
+
FinCoreRecordsCategory, ExchangeOrPublisher,
|
|
8
|
+
DataPrimaryCategory, DataState, DatasetPortionType,
|
|
9
|
+
DataSourceType,PipelineTriggerType, ExecutionLocation,
|
|
10
|
+
DataEventType, ComputeType, CloudProvider)
|
|
11
|
+
from .utils import (get_logger,
|
|
12
|
+
save_json_locally_extended,
|
|
13
|
+
write_json_to_cloud_storage_extended,
|
|
14
|
+
write_json_to_cloud_storage_with_pipelinemon_extended,
|
|
15
|
+
read_json_from_cloud_storage,
|
|
16
|
+
check_format_against_schema_template,
|
|
17
|
+
create_bigquery_schema_from_json,
|
|
18
|
+
read_csv_from_gcs, read_json_from_gcs,
|
|
19
|
+
write_csv_to_gcs,
|
|
20
|
+
write_json_to_gcs_extended,
|
|
21
|
+
write_json_to_gcs_with_pipelinemon_extended,
|
|
22
|
+
Pipelinemon, ContextLog)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
# pylint: disable=missing-module-docstring
|
|
3
|
+
# pylint: disable=missing-function-docstring
|
|
4
|
+
# pylint: disable=missing-class-docstring
|
|
5
|
+
|
|
6
|
+
from .enums_common_utils import (Status,
|
|
7
|
+
Unit,
|
|
8
|
+
Frequency)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
from .enums_modules import(Module,
|
|
12
|
+
Domain)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from .enums_module_fincore import (FinCoreCategory,
|
|
16
|
+
FincCoreSubCategory,
|
|
17
|
+
FinCoreRecordsCategory,
|
|
18
|
+
ExchangeOrPublisher)
|
|
19
|
+
|
|
20
|
+
from .enums_logs import (TargetLogs,
|
|
21
|
+
LogLevel)
|
|
22
|
+
|
|
23
|
+
from .enums_data_eng import (DataPrimaryCategory,
|
|
24
|
+
DataState,
|
|
25
|
+
DatasetPortionType,
|
|
26
|
+
DataSourceType,
|
|
27
|
+
PipelineTriggerType,
|
|
28
|
+
ExecutionLocation,
|
|
29
|
+
DataEventType,
|
|
30
|
+
ComputeType)
|
|
31
|
+
|
|
32
|
+
from .enums_cloud import (CloudProvider)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
# pylint: disable=missing-module-docstring
|
|
3
|
+
# pylint: disable=missing-function-docstring
|
|
4
|
+
# pylint: disable=missing-class-docstring
|
|
5
|
+
# pylint: disable=line-too-long
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CloudProvider(Enum):
|
|
11
|
+
GCP = "gcp"
|
|
12
|
+
AWS = "aws"
|
|
13
|
+
AZURE = "azure"
|
|
14
|
+
NO_CLOUD = "no_cloud"
|
|
15
|
+
CLOUD_AGNOSTIC = "cloud_agnostic"
|
|
16
|
+
OTHER = "other"
|
|
17
|
+
UNKNWON = "unknown"
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
|
|
2
|
+
# pylint: disable=missing-module-docstring
|
|
3
|
+
# pylint: disable=missing-function-docstring
|
|
4
|
+
# pylint: disable=missing-class-docstring
|
|
5
|
+
# pylint: disable=line-too-long
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Status(Enum):
|
|
11
|
+
OPEN = "open"
|
|
12
|
+
ACKNOWLEDGED = "acknowledged"
|
|
13
|
+
ESCALATED = "escalated"
|
|
14
|
+
IN_PROGRESS = "in_progress"
|
|
15
|
+
IN_REVIEW = "in_review"
|
|
16
|
+
RESOLVED = "resolved"
|
|
17
|
+
IGNORED = "ignored"
|
|
18
|
+
CANCELLED = "cancelled"
|
|
19
|
+
CLOSED = "closed"
|
|
20
|
+
|
|
21
|
+
### Exception during full exection, partially saved
|
|
22
|
+
# Exception during ensemble pipeline; modifications collected in local object , nothing persisted
|
|
23
|
+
# Exception during ensemble pipeline; modifications persisted , metadata failed
|
|
24
|
+
# Exception during ensemble pipeline; modifications persisted , metadata persisted
|
|
25
|
+
# Exception during ensemble pipeline; modifications persisted , metadata persisted
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Unit(Enum):
|
|
29
|
+
MIX="MIX"
|
|
30
|
+
# Currency and Financial Values
|
|
31
|
+
USD = "USD" # United States Dollar
|
|
32
|
+
EUR = "EUR" # Euro
|
|
33
|
+
JPY = "JPY" # Japanese Yen
|
|
34
|
+
GBP = "GBP" # British Pound Sterling
|
|
35
|
+
AUD = "AUD" # Australian Dollar
|
|
36
|
+
CAD = "CAD" # Canadian Dollar
|
|
37
|
+
CHF = "CHF" # Swiss Franc
|
|
38
|
+
CNY = "CNY" # Chinese Yuan Renminbi
|
|
39
|
+
SEK = "SEK" # Swedish Krona
|
|
40
|
+
NZD = "NZD" # New Zealand Dollar
|
|
41
|
+
MXN = "MXN" # Mexican Peso
|
|
42
|
+
SGD = "SGD" # Singapore Dollar
|
|
43
|
+
HKD = "HKD" # Hong Kong Dollar
|
|
44
|
+
NOK = "NOK" # Norwegian Krone
|
|
45
|
+
KRW = "KRW" # South Korean Won
|
|
46
|
+
RUB = "RUB" # Russian Ruble
|
|
47
|
+
INR = "INR" # Indian Rupee
|
|
48
|
+
BRL = "BRL" # Brazilian Real
|
|
49
|
+
ZAR = "ZAR" # South African Rand
|
|
50
|
+
CURRENCY = "currency" # General currency, when specific currency is not needed
|
|
51
|
+
|
|
52
|
+
# Stock Market and Investments
|
|
53
|
+
SHARES = "shares" # Number of shares
|
|
54
|
+
PERCENT = "prcnt" # Percentage, used for rates and ratios
|
|
55
|
+
BPS = "bps" # Basis points, often used for interest rates and financial ratios
|
|
56
|
+
|
|
57
|
+
# Volume and Quantitative Measurements
|
|
58
|
+
VOLUME = "volume" # Trading volume in units
|
|
59
|
+
MILLIONS = "mills" # Millions, used for large quantities or sums
|
|
60
|
+
BILLIONS = "bills" # Billions, used for very large quantities or sums
|
|
61
|
+
|
|
62
|
+
# Commodity Specific Units
|
|
63
|
+
BARRELS = "barrels" # Barrels, specifically for oil and similar liquids
|
|
64
|
+
TONNES = "tonnes" # Tonnes, for bulk materials like metals or grains
|
|
65
|
+
TROY_OUNCES = "troy_oz" # Troy ounces, specifically for precious metals
|
|
66
|
+
|
|
67
|
+
# Real Estate and Physical Properties
|
|
68
|
+
SQUARE_FEET = "sq_ft" # Square feet, for area measurement in real estate
|
|
69
|
+
METER_SQUARE = "m2" # Square meters, for area measurement in real estate
|
|
70
|
+
ACRES = "acres" # Acres, used for measuring large plots of land
|
|
71
|
+
|
|
72
|
+
# Miscellaneous and Other Measures
|
|
73
|
+
UNITS = "units" # Generic units, applicable when other specific units are not suitable
|
|
74
|
+
COUNT = "count" # Count, used for tallying items or events
|
|
75
|
+
INDEX_POINTS = "index_pnts" # Index points, used in measuring indices like stock market indices
|
|
76
|
+
RATIO = "ratio" # Ratio, for various financial ratios
|
|
77
|
+
|
|
78
|
+
class Frequency(Enum):
|
|
79
|
+
ONE_MIN = "1min"
|
|
80
|
+
FIVE_MIN="5min"
|
|
81
|
+
FIFTEEN_MIN="15min"
|
|
82
|
+
THIRTY_MIN = "30min"
|
|
83
|
+
ONE_H = "1h"
|
|
84
|
+
TWO_H = "2h"
|
|
85
|
+
SIX_H = "6h"
|
|
86
|
+
TWELVE_H = "12h"
|
|
87
|
+
FOUR_H = "4h"
|
|
88
|
+
EOD="eod"
|
|
89
|
+
ONE_D = "1d"
|
|
90
|
+
TWO_D = "2d"
|
|
91
|
+
THREE_D = "3d"
|
|
92
|
+
ONE_W = "1w"
|
|
93
|
+
ONE_M = "1m"
|
|
94
|
+
TWO_M="2m"
|
|
95
|
+
THREE_M="3m"
|
|
96
|
+
SIX_M="6m"
|
|
97
|
+
ONE_Y="1y"
|
|
98
|
+
THREE_Y="3y"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
# pylint: disable=missing-function-docstring
|
|
3
|
+
# pylint: disable=missing-class-docstring
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DataPrimaryCategory(Enum):
|
|
8
|
+
HISTORIC = "historic" # Historical data, usually accurate and complete
|
|
9
|
+
HISTORIC_OPINION="histopinion" # Opinions and subjective data about the past, msotly unverified but recorded facts and ideas
|
|
10
|
+
REAL_TIME="realtime" # Real-time data, not always certain, can have error
|
|
11
|
+
ANALYTICS="analytics" # Analytical data and modelling, derived from historical and prediction data. Normally shall be making Human readable sense. vs. Features
|
|
12
|
+
FEATURES="features" # Feature data, used for training models
|
|
13
|
+
PREDICTIVE="predictive" # Predictive data, based on models and simulations
|
|
14
|
+
|
|
15
|
+
SIMULATION_HISTORIC = "simhistoric" # Simulates past events
|
|
16
|
+
SIMULATION_REAL_TIME = "simrealtime" # Simulates live data streams
|
|
17
|
+
SIMULATION_ANALYTICS = "simanalytics" # Simulates live data streams
|
|
18
|
+
SIMULATION_PREDICTIVE="simpredictive" # Simulated data, used for testing and training
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DataState(Enum):
|
|
22
|
+
RAW = "raw" # Raw data, unprocessed, unverified
|
|
23
|
+
FORMATTED= "formatted" # Formatted data
|
|
24
|
+
CLEANED = "cleaned" # Cleaned data, of outliers and errors, filled
|
|
25
|
+
PROCESSED = "processed" # Processed data, cleaned
|
|
26
|
+
MODELED = "modeled" # Modeled data, processed and verified
|
|
27
|
+
SIMULATED = "simulated" # Simulated data, processed and verified
|
|
28
|
+
ANALYZED = "analyzed" # Analyzed data, processed and verified
|
|
29
|
+
VERIFIED = "verified" # Verified data, separate category for data that has been verified. Perhaps Stock market prices cross checked between several sources
|
|
30
|
+
|
|
31
|
+
class DatasetPortionType(Enum):
|
|
32
|
+
FULL_DATA= "full_data"
|
|
33
|
+
PARTIAL_DATA= "partial_data"
|
|
34
|
+
RECENT_LAST_DATA = "recent_last_data"
|
|
35
|
+
RECENT_GAP_DATA = "recent_gap_data"
|
|
36
|
+
|
|
37
|
+
class DataSourceType(Enum):
|
|
38
|
+
API = "api"
|
|
39
|
+
WEBSITE = "website"
|
|
40
|
+
LOCAL_STORAGE = "local_storage"
|
|
41
|
+
INMEMORY = "inmemory"
|
|
42
|
+
GCS = "gcs"
|
|
43
|
+
DB = "db"
|
|
44
|
+
BQ = "bq"
|
|
45
|
+
FIREBASE = "firebase"
|
|
46
|
+
MONGODB = "mongodb"
|
|
47
|
+
PUBSUB = "pubsub"
|
|
48
|
+
REDIS = "redis"
|
|
49
|
+
S3 = "s3"
|
|
50
|
+
AZURE_BLOB = "azure_blob"
|
|
51
|
+
WEBSOCKET = "websocket"
|
|
52
|
+
KAFKA = "kafka"
|
|
53
|
+
ELASTICSEARCH = "elasticsearch"
|
|
54
|
+
CASSANDRA = "cassandra"
|
|
55
|
+
DYNAMODB = "dynamodb"
|
|
56
|
+
MEMSQL = "memsql"
|
|
57
|
+
ORACLE = "oracle"
|
|
58
|
+
POSTGRESQL = "postgresql"
|
|
59
|
+
SQLSERVER = "sqlserver"
|
|
60
|
+
MYSQL = "mysql"
|
|
61
|
+
|
|
62
|
+
class PipelineTriggerType(Enum):
|
|
63
|
+
MANUAL = "manual"
|
|
64
|
+
SCHEDULED_RECENT = "scheduled_recent"
|
|
65
|
+
SCHEDULED_VERIFICATION = "scheduled_verification"
|
|
66
|
+
EVENT_GCS_UPLOAD= "event_gcs_upload"
|
|
67
|
+
EVENT_PUBSUB= "event_pubsub"
|
|
68
|
+
INSIDE_FUNCTION = "inside_function"
|
|
69
|
+
|
|
70
|
+
class ExecutionLocation(Enum):
|
|
71
|
+
LOCAL_SCRIPT = "local_script"
|
|
72
|
+
LOCAL_JUPYTER_NOTEBOOK = "local_jupyter_notebook"
|
|
73
|
+
CLOUD_JUPYTER = "cloud_jupyter_notebook"
|
|
74
|
+
LOCAL_CF_EVENT_HTTP = "local_cf_event_http"
|
|
75
|
+
CLOUD_CF_EVENT_HTTP = "cloud_cf_event_http"
|
|
76
|
+
LOCAL_CF_EVENT_PUBSUB = "local_cf_event_pubsub"
|
|
77
|
+
CLOUD_CF_EVENT_PUBSUB = "cloud_cf_event_pubsub"
|
|
78
|
+
LOCAL_CF_EVENT_GCS = "local_cf_event_gcs"
|
|
79
|
+
CLOUD_CF_EVENT_GCS = "cloud_cf_event_gcs"
|
|
80
|
+
LOCAL_CF_EVENT_DB = "local_cf_event_db"
|
|
81
|
+
CLOUD_CF_EVENT_DB = "cloud_cf_event_db"
|
|
82
|
+
|
|
83
|
+
class DataEventType(Enum):
|
|
84
|
+
INSERT_NOREPLACE_1O_NT = "insert_noreplace_1o_nt"
|
|
85
|
+
MERGE_NOREPLACE_NO_1T = "merge_noreplace_no_1t"
|
|
86
|
+
MERGE_NOREPLACE_NO_NT = "merge_noreplace_no_nt"
|
|
87
|
+
INSERT_NOREPLACE_1O_1T = "insert_noreplace_1o_1t"
|
|
88
|
+
MERGE_NOREPLACE_1O_NT = "merge_noreplace_1o_nt"
|
|
89
|
+
INSERT_REPLACE_1O_1T = "insert_replace_1o_1t"
|
|
90
|
+
INSERT_REPLACE_1O_NT = "insert_replace_1o_nt"
|
|
91
|
+
MERGE_REPLACE_NO_NT = "merge_replace_no_nt"
|
|
92
|
+
MERGE_REPLACE_1O_NT = "merge_replace_1o_nt"
|
|
93
|
+
MERGE_REPLACE_NO_1T = "merge_replace_no_1t"
|
|
94
|
+
DELETE_1O_1T = "delete_1o_1t"
|
|
95
|
+
DELETE_1O_NT = "delete_1o_nt"
|
|
96
|
+
DELETE_NO_1T = "delete_no_1t"
|
|
97
|
+
DELETE_NO_NT = "delete_no_nt"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class ComputeType(Enum):
|
|
102
|
+
CPU= "cpu"
|
|
103
|
+
GPU= "gpu"
|
|
104
|
+
SPARK= "spark"
|
|
105
|
+
TPU= "tpu"
|
|
106
|
+
FPGA= "fpga"
|
|
107
|
+
ASIC= "asic"
|
|
108
|
+
QUANTUM= "quantum"
|
|
109
|
+
HADOOP= "hadoop"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
# pylint: disable=missing-function-docstring
|
|
3
|
+
# pylint: disable=missing-class-docstring
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TargetLogs(Enum):
|
|
9
|
+
MIXED="mixed_logs"
|
|
10
|
+
SUCCESSES = "success_logs"
|
|
11
|
+
NOTICES = "notice_logs"
|
|
12
|
+
SUCCESSES_AND_NOTICES = "succs_n_notc_logs"
|
|
13
|
+
WARNINGS = "warning_logs"
|
|
14
|
+
WARNINGS_AND_ERRORS = "warn_n_err_logs"
|
|
15
|
+
ERRORS = "error_logs"
|
|
16
|
+
|
|
17
|
+
class LogLevel(Enum):
|
|
18
|
+
"""
|
|
19
|
+
Standardized notice levels for data engineering pipelines,
|
|
20
|
+
designed for easy analysis and identification of manual
|
|
21
|
+
intervention needs.
|
|
22
|
+
"""
|
|
23
|
+
DEBUG = 10 # Detailed debug information (for development/troubleshooting)
|
|
24
|
+
|
|
25
|
+
INFO = 100
|
|
26
|
+
INFO_REMOTE_PERSISTNACE_COMPLETE= 101
|
|
27
|
+
INFO_REMOTE_UPDATE_COMPLETE = 102
|
|
28
|
+
INFO_REMOTE_DELETE_COMPLETE = 103
|
|
29
|
+
|
|
30
|
+
INFO_REMOTE_BULK_PERSISTNACE_COMPLETE= 111
|
|
31
|
+
INFO_REMOTE_BULK_UPDATE_COMPLETE = 112
|
|
32
|
+
INFO_REMOTE_BULK_DELETE_COMPLETE = 113
|
|
33
|
+
|
|
34
|
+
INFO_LOCAL_PERSISTNACE_COMPLETE = 121
|
|
35
|
+
|
|
36
|
+
SUCCESS = 201
|
|
37
|
+
SUCCESS_WITH_NOTICES = 211
|
|
38
|
+
SUCCESS_WITH_WARNINGS = 212
|
|
39
|
+
|
|
40
|
+
NOTICE = 300 # Maybe same file or data already fully or partially exists
|
|
41
|
+
NOTICE_ALREADY_EXISTS = 301 # Data already exists, no action required
|
|
42
|
+
NOTICE_PARTIAL_EXISTS = 302 # Partial data exists, no action required
|
|
43
|
+
NOTICE_ACTION_CANCELLED = 303 # Data processing cancelled, no action required
|
|
44
|
+
|
|
45
|
+
# Warnings indicate potential issues that might require attention:
|
|
46
|
+
WARNING = 400 # General warning, no immediate action required
|
|
47
|
+
# WARNING_NO_ACTION = 401 # Minor issue or Unexpected Behavior, no immediate action required (can be logged frequently)
|
|
48
|
+
WARNING_REVIEW_RECOMMENDED = 402 # Action recommended to prevent potential future issues
|
|
49
|
+
WARNING_FIX_RECOMMENDED = 403 # Action recommended to prevent potential future issues
|
|
50
|
+
WARNING_FIX_REQUIRED = 404 # Action required, pipeline can likely continue
|
|
51
|
+
|
|
52
|
+
ERROR = 500 # General error, no immediate action required
|
|
53
|
+
|
|
54
|
+
ERROR_EXCEPTION = 501
|
|
55
|
+
ERROR_CUSTOM = 502 # Temporary error, automatic retry likely to succeed
|
|
56
|
+
|
|
57
|
+
ERROR_OPERATION_PARTIALLY_FAILED = 511 # Partial or full failure, manual intervention required
|
|
58
|
+
ERROR_OPERATION_FAILED = 512 # Operation failed, manual intervention required
|
|
59
|
+
ERORR_OPERATION_WITH_WARNINGS = 513 # Partial or full failure, manual intervention required
|
|
60
|
+
ERORR_OPERATION_WITH_ERRORS = 514 # Partial or full failure, manual intervention required
|
|
61
|
+
ERORR_OPERATION_WITH_WARNINGS_OR_ERRORS = 515 # Partial or full failure, manual intervention required
|
|
62
|
+
|
|
63
|
+
ERROR_PERSISTANCE_FAILED = 522 # Data persistance failed, manual intervention required
|
|
64
|
+
ERROR_UPDATE_FAILED = 523 # Data update failed, manual intervention required
|
|
65
|
+
ERROR_DELETE_FAILED = 524 # Data deletion failed, manual intervention required
|
|
66
|
+
ERROR_PERSISTANCE_WITH_ERRORS = 525 # Data persistance failed, manual intervention required
|
|
67
|
+
ERROR_UPDATE_WITH_ERRORS = 526 # Data update failed, manual intervention required
|
|
68
|
+
ERROR_DELETE_WITH_ERRORS = 527 # Data deletion failed, manual intervention required
|
|
69
|
+
|
|
70
|
+
ERROR_THRESHOLD_REACHED = 551
|
|
71
|
+
ERROR_PIPELINE_THRESHOLD_REACHED = 552 # Error due to threshold reached, no immediate action required
|
|
72
|
+
ERROR_SUBTHRESHOLD_REACHED = 553 # Error due to threshold reached, no immediate action required
|
|
73
|
+
ERROR_DATA_QUALITY_THRESHOLD_REACHED = 554 # Error due to threshold reached, no immediate action required
|
|
74
|
+
ERROR_METADATA_QUALITY_THRESHOLD_REACHED = 555 # Error due to threshold reached, no immediate action required
|
|
75
|
+
# Critical errors indicate severe failures requiring immediate attention:
|
|
76
|
+
CRITICAL=600 # General critical error, requires immediate action
|
|
77
|
+
CRITICAL_SYSTEM_FAILURE = 601 # System-level failure (e.g., infrastructure, stackoverflow ), requires immediate action
|
|
78
|
+
|
|
79
|
+
UNKNOWN=1001 # Unknown error, should not be used in normal operation
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
# pylint: disable=missing-function-docstring
|
|
3
|
+
# pylint: disable=missing-class-docstring
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class FinCoreCategory(Enum):
|
|
8
|
+
MARKET="market" # Market prices data
|
|
9
|
+
CORPORATE="corp" # Corporate data such as financial statements and earnings, similar to fundamental data
|
|
10
|
+
FUNDAMENTAL="fundam"
|
|
11
|
+
ECONOMY="economy"
|
|
12
|
+
NEWS="news"
|
|
13
|
+
SENTIMENT="sntmnt"
|
|
14
|
+
SOCIAL="social"
|
|
15
|
+
POLITICS="poltcs"
|
|
16
|
+
OTHER="other"
|
|
17
|
+
|
|
18
|
+
class FincCoreSubCategory(Enum):
|
|
19
|
+
STOCKS = "stocks"
|
|
20
|
+
BONDS = "bonds"
|
|
21
|
+
COMMODITIES = "cmmdt"
|
|
22
|
+
CURRENCIES = "crrncy"
|
|
23
|
+
CRYPTOCURRENCIES = "crypto"
|
|
24
|
+
REAL_ESTATE = "realest"
|
|
25
|
+
EQUITY_INDICES = "eqindx"
|
|
26
|
+
OPTIONS = "options"
|
|
27
|
+
FUTURES = "futures"
|
|
28
|
+
ETF = "etf"
|
|
29
|
+
ECONOMIC_INDICATORS = "ecoind"
|
|
30
|
+
FUNDAMENTALS = "fundam"
|
|
31
|
+
OTHER = "othr"
|
|
32
|
+
|
|
33
|
+
class FinCoreRecordsCategory(Enum):
|
|
34
|
+
PRICE="pric"
|
|
35
|
+
SPOT= "spot"
|
|
36
|
+
OHLCVA="ohlcva"
|
|
37
|
+
OHLCV="ohlcv"
|
|
38
|
+
OPEN="open"
|
|
39
|
+
HIGH="high"
|
|
40
|
+
LOW="low"
|
|
41
|
+
CLOSE="close"
|
|
42
|
+
VOLUME="volume"
|
|
43
|
+
ADJC="adjc"
|
|
44
|
+
FUNDAMENTAL="fundam" # treat this differently
|
|
45
|
+
EARNINGS="earnings"
|
|
46
|
+
CASH_FLOW="cashflw"
|
|
47
|
+
BALANCE_SHEET="blnce_sht"
|
|
48
|
+
INTERNAL_TRANSACTIONS="internaltrans"
|
|
49
|
+
INDICATORS="indic"
|
|
50
|
+
ARTICLE="article"
|
|
51
|
+
INSTA_POST="isntapost"
|
|
52
|
+
TWEET="tweet"
|
|
53
|
+
OTHER="othr"
|
|
54
|
+
|
|
55
|
+
class ExchangeOrPublisher(Enum):
|
|
56
|
+
CC="cc"
|
|
57
|
+
US="us"
|
|
58
|
+
NASDAQ="nasdaq"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
# pylint: disable=missing-module-docstring
|
|
3
|
+
# pylint: disable=missing-function-docstring
|
|
4
|
+
# pylint: disable=missing-class-docstring
|
|
5
|
+
# pylint: disable=line-too-long
|
|
6
|
+
from enum import Enum
|
|
7
|
+
|
|
8
|
+
class Module(Enum):
|
|
9
|
+
CORE="core"
|
|
10
|
+
ORACLE="oracle"
|
|
11
|
+
PORTFOLIO="portfolio"
|
|
12
|
+
RISK="risk"
|
|
13
|
+
RESEARCH="research"
|
|
14
|
+
TRADING="trading"
|
|
15
|
+
SIMULATION="simulation"
|
|
16
|
+
|
|
17
|
+
class Domain(Enum):
|
|
18
|
+
FINCORE="fincore"
|
|
19
|
+
GYMCORE="gymcore"
|
|
20
|
+
HEALTHCORE="healthcore"
|
|
21
|
+
ENVICORE="envicore"
|
|
22
|
+
SPORTSCORE="sportscore"
|
|
23
|
+
POLICORE="policore"
|
|
24
|
+
CUSTOM="custom"
|
|
25
|
+
|
|
@@ -13,50 +13,40 @@ resource_classifications = {
|
|
|
13
13
|
"internal_confidential", ## Few Internal employees Can Access. ex: internal user data, key financials, salaries and bonuses etc
|
|
14
14
|
"internal_limitedacl", ## Has to employee usertype and in the ACL
|
|
15
15
|
"internal_owner"
|
|
16
|
-
|
|
17
|
-
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
|
|
21
19
|
resource_domain = {
|
|
22
20
|
"*",
|
|
23
|
-
############### GYM #########
|
|
21
|
+
############### GYM #########
|
|
24
22
|
"gym_domain",
|
|
25
23
|
"gym_data_domain",
|
|
26
24
|
"gym_ai_domain",
|
|
27
|
-
############## ORACLE #########
|
|
25
|
+
############## ORACLE #########
|
|
28
26
|
"oracle_domain",
|
|
29
|
-
"
|
|
27
|
+
"oracle_historic_prices_domain",
|
|
30
28
|
"oracle_ai_domain",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"oracle_indicators_historic_domain",
|
|
29
|
+
"oracle_assests_historic_info_domain",
|
|
30
|
+
"oracle_historic_econometrics_domain",
|
|
34
31
|
"oracle_news_historic_domain",
|
|
35
32
|
"oracle_calendar_domain",
|
|
36
33
|
"oracle_modelinfo_domain",
|
|
37
34
|
"oracle_modelmetrics_domain",
|
|
38
35
|
"oracle_modelpredictions_domain",
|
|
39
|
-
######### ORGANISATIONS #########
|
|
36
|
+
######### ORGANISATIONS #########
|
|
40
37
|
"organisation_domain",
|
|
41
|
-
################### USER #########
|
|
38
|
+
################### USER #########
|
|
42
39
|
"user_domain",
|
|
43
40
|
"user_management_domain",
|
|
44
41
|
"user_portfolio_domain",
|
|
45
42
|
"user_groups_and_roles_domain",
|
|
46
|
-
############### BUSINESS #########
|
|
43
|
+
############### BUSINESS #########
|
|
47
44
|
"business_domain",
|
|
48
|
-
############### ANALYTICS #########
|
|
45
|
+
############### ANALYTICS #########
|
|
49
46
|
"analytics_domain",
|
|
50
|
-
|
|
51
47
|
"system_domain"
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
resource_location = {
|
|
55
|
-
"firestore_default_",
|
|
56
|
-
"github_ipulse_ui_main", "github_authz_main","github_authz_staging",
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
50
|
resource_types = {
|
|
61
51
|
"db", "sql_db", "nosql_db", "dynamodb",
|
|
62
52
|
"big_query", "big_query_project", "big_query_table", "big_query_column",
|
|
@@ -70,30 +60,7 @@ resource_types = {
|
|
|
70
60
|
"api", "report", "dashboard", "webpage", "website", "web"
|
|
71
61
|
}
|
|
72
62
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
resource_original_or_processed = {"*",
|
|
76
|
-
"original_source", # Example User Profiles
|
|
77
|
-
"original_copy",
|
|
78
|
-
"processed_source",
|
|
79
|
-
"processed_copy",
|
|
80
|
-
"mixed_source",
|
|
81
|
-
"mixed_copy" }
|
|
82
|
-
|
|
83
|
-
pulse_modules={
|
|
84
|
-
"*",
|
|
85
|
-
"core",
|
|
86
|
-
"gym",
|
|
87
|
-
"orcl",
|
|
88
|
-
"scen",
|
|
89
|
-
"invs",
|
|
90
|
-
"prfl",
|
|
91
|
-
"trde",
|
|
92
|
-
"bet",
|
|
93
|
-
"chat"
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
organisation_relations = {
|
|
63
|
+
organisation_relations = {
|
|
97
64
|
"*",
|
|
98
65
|
"retail_customer",
|
|
99
66
|
"corporate_customer",
|
|
@@ -161,9 +128,6 @@ licences_types={
|
|
|
161
128
|
}
|
|
162
129
|
|
|
163
130
|
|
|
164
|
-
|
|
165
|
-
effects={"allow", "deny"}
|
|
166
|
-
|
|
167
131
|
actions ={"GET",
|
|
168
132
|
"POST",
|
|
169
133
|
"DELETE",
|