orbitkit 0.8.39__tar.gz → 0.8.41__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.
- {orbitkit-0.8.39/orbitkit.egg-info → orbitkit-0.8.41}/PKG-INFO +1 -1
- orbitkit-0.8.41/orbitkit/VERSION +1 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/airflow_handler/data_preprocessing.py +10 -1
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/airflow_handler/file_handler_v2.py +7 -6
- {orbitkit-0.8.39 → orbitkit-0.8.41/orbitkit.egg-info}/PKG-INFO +1 -1
- orbitkit-0.8.39/orbitkit/VERSION +0 -1
- {orbitkit-0.8.39 → orbitkit-0.8.41}/LICENSE +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/MANIFEST.in +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/README.md +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/airflow_handler/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/airflow_handler/file_flow_entry_process.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/airflow_handler/file_flow_exit_process.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/airflow_handler/file_handler.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/audio_transcoder/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/audio_transcoder/netmind_extract_v1.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/constant/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/constant/report_schema.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/id_srv/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/id_srv/id_gen.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/id_srv/id_perm_like.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/lark_send/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/lark_send/lark.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/llm_tools/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/llm_tools/quick_rag_chat.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/orbit_type/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/orbit_type/doc_4_compile_rule.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/orbit_type/orbit_type_simple.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/orbit_type/tools.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_embedding/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_embedding/pdf_txt_embedding.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_embedding/pdf_txt_embedding_v2.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/a_stock_extractor_v1.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/exceptions.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_block_extractor_base.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_block_extractor_v1.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_block_extractor_v2.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_extractor_azure.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_extractor_minerU_v1.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_extractor_netmind_v1.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_extractor_netmind_v2.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_extractor_netmind_v3.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor/pdf_extractor_orbit.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/base.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/cloud_provider.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/core.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/exceptions.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/extractors.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_extractor_simple/utils.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_writer/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/pdf_writer/pdf_writer_simple.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/__init__.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/cache_asset_downloader.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/common.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/customize_regix_manager.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/secret_manager.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_aliyun.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_aliyun_oss_simple.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_aws.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_aws_s3_wrapper.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_date.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_html.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_kafka.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_md5.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_selenium.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_simple_timer.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_str.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_type_mapping.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit/util/util_url.py +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit.egg-info/SOURCES.txt +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit.egg-info/dependency_links.txt +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit.egg-info/not-zip-safe +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit.egg-info/requires.txt +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/orbitkit.egg-info/top_level.txt +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/setup.cfg +0 -0
- {orbitkit-0.8.39 → orbitkit-0.8.41}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.8.41
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import datetime
|
|
3
3
|
from collections import defaultdict
|
|
4
|
+
from googletrans import Translator
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class DocumentProcessor:
|
|
8
|
+
|
|
7
9
|
AUDIO_SUFFIXES = [".mp3", ".wav", ".aac", ".wma", ".m4a"]
|
|
8
10
|
VIDEO_SUFFIXES = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".hevc"]
|
|
9
11
|
PDF_SUFFIXES = [".pdf"]
|
|
@@ -17,6 +19,12 @@ class DocumentProcessor:
|
|
|
17
19
|
def get_file_suffix(file_path):
|
|
18
20
|
return f".{file_path.split('.')[-1]}".lower()
|
|
19
21
|
|
|
22
|
+
@staticmethod
|
|
23
|
+
def translate_text(text, dest='en'):
|
|
24
|
+
translator = Translator()
|
|
25
|
+
result = translator.translate(text, dest=dest)
|
|
26
|
+
return result.text
|
|
27
|
+
|
|
20
28
|
@staticmethod
|
|
21
29
|
def create_xbrl_template():
|
|
22
30
|
return {
|
|
@@ -124,7 +132,8 @@ class DocumentProcessor:
|
|
|
124
132
|
_, ext = os.path.splitext(att['store_path'])
|
|
125
133
|
if ext in cls.AUDIO_SUFFIXES or ext in cls.VIDEO_SUFFIXES:
|
|
126
134
|
add_extends = {
|
|
127
|
-
"
|
|
135
|
+
"original_title": doc['x_orbit_data']['report_title'],
|
|
136
|
+
"title": cls.translate_text(doc['x_orbit_data']['report_title']),
|
|
128
137
|
"published": doc['x_reported_at_utc_date'],
|
|
129
138
|
"tickers": [],
|
|
130
139
|
"perm_id_list": doc['x_orbit_data']['perm_id_list'],
|
|
@@ -5,7 +5,8 @@ from contextlib import contextmanager
|
|
|
5
5
|
from typing import List, Dict, Tuple, Any, Optional, Union
|
|
6
6
|
from sqlalchemy.dialects.postgresql import array
|
|
7
7
|
from sqlalchemy.orm import sessionmaker, scoped_session
|
|
8
|
-
from sqlalchemy import create_engine, MetaData, Table, select, Column, Integer, insert, and_, text, delete, update,
|
|
8
|
+
from sqlalchemy import create_engine, MetaData, Table, select, Column, Integer, insert, and_, text, delete, update, \
|
|
9
|
+
desc, LABEL_STYLE_TABLENAME_PLUS_COL
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(__name__)
|
|
11
12
|
|
|
@@ -397,9 +398,9 @@ class FileFlowHandleV2:
|
|
|
397
398
|
select(op_meta)
|
|
398
399
|
.where(and_(*conditions)) if conditions else select(op_meta)
|
|
399
400
|
)
|
|
400
|
-
meta_subquery = meta_subquery.order_by(desc(op_meta.c.priority)).limit(limit_size).subquery()
|
|
401
|
+
meta_subquery = meta_subquery.order_by(desc(op_meta.c.priority)).limit(limit_size).subquery(name="public_op_meta")
|
|
401
402
|
join_stmt = meta_subquery.outerjoin(op_attachment, meta_subquery.c.id == op_attachment.c.meta_id)
|
|
402
|
-
stmt = select(meta_subquery, op_attachment).select_from(join_stmt)
|
|
403
|
+
stmt = (select(meta_subquery, op_attachment).select_from(join_stmt).set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL))
|
|
403
404
|
|
|
404
405
|
with self.session_scope() as session:
|
|
405
406
|
result = session.execute(stmt).fetchall()
|
|
@@ -407,10 +408,10 @@ class FileFlowHandleV2:
|
|
|
407
408
|
meta_map = {}
|
|
408
409
|
for row in result:
|
|
409
410
|
row_dict = dict(row._mapping)
|
|
410
|
-
meta_id = row_dict['
|
|
411
|
+
meta_id = row_dict['public_op_meta_id']
|
|
411
412
|
|
|
412
|
-
meta_fields: Dict[str, Any] = {k: v for k, v in row_dict.items() if k
|
|
413
|
-
attachment_fields: Dict[str, Any] = {k: v for k, v in row_dict.items() if k
|
|
413
|
+
meta_fields: Dict[str, Any] = {k.replace('public_op_meta_', ''): v for k, v in row_dict.items() if k.startswith('public_op_meta_')}
|
|
414
|
+
attachment_fields: Dict[str, Any] = {k.replace('public_op_attachment_', ''): v for k, v in row_dict.items() if k.startswith('public_op_attachment_')}
|
|
414
415
|
|
|
415
416
|
meta_fields['created_at'] = meta_fields['created_at'].isoformat()
|
|
416
417
|
meta_fields['updated_at'] = meta_fields['updated_at'].isoformat()
|
orbitkit-0.8.39/orbitkit/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.8.39
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|