db-toolkit 0.0.2__tar.gz → 0.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db-toolkit
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: utility tools for db access and data extraction
5
5
  Home-page: https://github.com/Analytics/db-toolkit
6
6
  Author: frangs
@@ -0,0 +1 @@
1
+ __version__ = "0.0.3"
@@ -40,6 +40,8 @@ d = { 'settings': { 'branch': 'main',
40
40
  'db_toolkit/db_extract.py'),
41
41
  'db_toolkit.db_extract.DBExtract.process_save_landing': ( 'db_extract.html#dbextract.process_save_landing',
42
42
  'db_toolkit/db_extract.py'),
43
+ 'db_toolkit.db_extract.DBExtract.sample': ( 'db_extract.html#dbextract.sample',
44
+ 'db_toolkit/db_extract.py'),
43
45
  'db_toolkit.db_extract.PullManifest': ('db_extract.html#pullmanifest', 'db_toolkit/db_extract.py'),
44
46
  'db_toolkit.db_extract.PullManifest.__init__': ( 'db_extract.html#pullmanifest.__init__',
45
47
  'db_toolkit/db_extract.py'),
@@ -72,6 +72,14 @@ class DBExtract:
72
72
 
73
73
 
74
74
 
75
+ # %% ../nbs/02_db_extract.ipynb #bc75d61c-94cb-4322-a1bf-d3be6d73110f
76
+ @patch
77
+ def sample(self: DBExtract, name, n=100):
78
+ """Pull first n rows from a table for testing"""
79
+ self._get_pairs()
80
+ _, conn, sql = next((p for p in self.pairs if p[0] == name))
81
+ return next(self._get_data_stream(conn, sql, chunksize=n))
82
+
75
83
  # %% ../nbs/02_db_extract.ipynb #b6b66498-f021-4fe5-9706-43f27bad1fdb
76
84
  class PullManifest:
77
85
  def __init__(self, manifest_path, pull_interval_days=14):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db-toolkit
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: utility tools for db access and data extraction
5
5
  Home-page: https://github.com/Analytics/db-toolkit
6
6
  Author: frangs
@@ -5,7 +5,7 @@
5
5
  ### Python library ###
6
6
  repo = db-toolkit
7
7
  lib_name = %(repo)s
8
- version = 0.0.2
8
+ version = 0.0.3
9
9
  min_python = 3.9
10
10
  license = apache2
11
11
  black_formatting = False
@@ -43,4 +43,4 @@ requirements = fastcore pandas sqlalchemy
43
43
  # dev_requirements =
44
44
  # console_scripts =
45
45
  # conda_user =
46
- # package_data =
46
+ # package_data =
@@ -1 +0,0 @@
1
- __version__ = "0.0.2"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes