linkarchivetools 0.1.16__tar.gz → 0.1.18__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.
Files changed (18) hide show
  1. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/PKG-INFO +4 -3
  2. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/utils/reflected.py +51 -0
  3. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/pyproject.toml +2 -2
  4. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/LICENSE +0 -0
  5. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/README.md +0 -0
  6. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/LICENSE +0 -0
  7. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/README.md +0 -0
  8. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/__init__.py +0 -0
  9. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/backup.py +0 -0
  10. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/db2feeds.py +0 -0
  11. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/db2json.py +0 -0
  12. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/dbanalyzer.py +0 -0
  13. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/dbfilter.py +0 -0
  14. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/dbmerge.py +0 -0
  15. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/json2db.py +0 -0
  16. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/tableconfig.py +0 -0
  17. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/utils/alchemysearch.py +0 -0
  18. {linkarchivetools-0.1.16 → linkarchivetools-0.1.18}/linkarchivetools/utils/omnisearch.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: linkarchivetools
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: Link Archive Tools
5
5
  License: GPL3
6
6
  Author: Iwan Grozny
@@ -11,12 +11,13 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Requires-Dist: psycopg2-binary
15
16
  Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
16
17
  Requires-Dist: requests (>=2.32.5,<3.0.0)
17
18
  Requires-Dist: sqlalchemy
18
19
  Requires-Dist: sympy (>=1.13.2,<2.0.0)
19
- Requires-Dist: webtoolkit (>=0.0.191,<0.0.192)
20
+ Requires-Dist: webtoolkit (>=0.0.194,<0.0.195)
20
21
  Description-Content-Type: text/markdown
21
22
 
22
23
  # Link Database Tools
@@ -42,6 +42,11 @@ class ReflectedTable(object):
42
42
 
43
43
  index.create(bind=self.engine)
44
44
 
45
+ def enable_sqlite_wal(self, table_name):
46
+ sql_text = f"PRAGMA journal_mode=WAL;"
47
+ self.connection.execute(text(sql_text))
48
+ self.connection.commit()
49
+
45
50
  def vacuum(self):
46
51
  self.connection.execute(text("VACUUM"))
47
52
 
@@ -129,6 +134,11 @@ class ReflectedGenericTable(object):
129
134
  self.connection.execute(text(sql_text))
130
135
  self.connection.commit()
131
136
 
137
+ def enable_sqlite_wal(self):
138
+ sql_text = f"PRAGMA journal_mode=WAL;"
139
+ self.connection.execute(text(sql_text))
140
+ self.connection.commit()
141
+
132
142
  def create_index(self, column_name):
133
143
  index_name = f"idx_{self.table.name}_{column_name}"
134
144
  index = Index(index_name, getattr(table.c, column_name))
@@ -468,6 +478,19 @@ class ReflectedSourceTable(ReflectedGenericTable):
468
478
  return self.connection.execute(stmt).scalar()
469
479
 
470
480
 
481
+ class ReflectedSourceOperationalData(ReflectedGenericTable):
482
+ def get_table_name(self):
483
+ return "sourceoperationaldata"
484
+
485
+ def get_for_source(self, source_id):
486
+ destination_table = self.get_table()
487
+
488
+ stmt = select(destination_table).where(destination_table.c.source_obj_id == source_id)
489
+
490
+ result = self.connection.execute(stmt)
491
+ return result.first()
492
+
493
+
471
494
  class ReflectedSocialData(ReflectedGenericTable):
472
495
  def get_table_name(self):
473
496
  return "socialdata"
@@ -494,6 +517,34 @@ class ReflectedEntryRules(ReflectedGenericTable):
494
517
  return "entryrules"
495
518
 
496
519
 
520
+ class ReflectedConfigurationEntry(ReflectedGenericTable):
521
+ def get_table_name(self):
522
+ return "configurationentry"
523
+
524
+ def get(self):
525
+ first_item = self.get_first()
526
+ if first_item:
527
+ return first_item
528
+
529
+ self.add_configuration()
530
+
531
+ first_item = self.get_first()
532
+ if first_item:
533
+ return first_item
534
+
535
+ def get_first(self):
536
+ destination_table = self.get_table()
537
+
538
+ stmt = select(destination_table)
539
+
540
+ result = self.connection.execute(stmt)
541
+ return result.first()
542
+
543
+ def add_configuration(self):
544
+ json_data = {}
545
+ self.insert_json_data(json_data)
546
+
547
+
497
548
  class EntryCopier(object):
498
549
  def __init__(self, src_engine, src_connection, dst_engine, dst_connection):
499
550
  self.src_engine = src_engine
@@ -3,7 +3,7 @@
3
3
 
4
4
  [tool.poetry]
5
5
  name = "linkarchivetools"
6
- version = "0.1.16"
6
+ version = "0.1.18"
7
7
  description = "Link Archive Tools"
8
8
  authors = ["Iwan Grozny <renegat@renegat0x0.ddns.net>"]
9
9
  license = "GPL3"
@@ -13,7 +13,7 @@ readme = "README.md"
13
13
  python = "^3.10"
14
14
  python-dateutil = "^2.8.2"
15
15
  sqlalchemy="*"
16
- webtoolkit="^0.0.191"
16
+ webtoolkit="^0.0.194"
17
17
  sympy="^1.13.2"
18
18
  psycopg2-binary="*"
19
19