qufe 0.1.2__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.
qufe-0.1.2/MANIFEST.in ADDED
@@ -0,0 +1,9 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ include MANIFEST.in
5
+
6
+ recursive-include qufe *.py
7
+ recursive-exclude * __pycache__
8
+ recursive-exclude * *.py[co]
9
+ recursive-exclude * .DS_Store
qufe-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: qufe
3
+ Version: 0.1.2
4
+ Summary: A comprehensive Python utility library for data processing, file handling, database management, and automation tasks
5
+ Author-email: Bongtae Jeon <bongtae.jeon@gmail.com>
6
+ Maintainer-email: Bongtae Jeon <bongtae.jeon@gmail.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://dev.qufe.net/
9
+ Project-URL: Repository, https://github.com/qufe/qufe
10
+ Project-URL: Documentation, https://qufe.readthedocs.io
11
+ Project-URL: Bug Tracker, https://github.com/qufe/qufe/issues
12
+ Keywords: utilities,automation,data-processing,database,file-handling,web-scraping,image-processing
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Utilities
25
+ Classifier: Topic :: Database
26
+ Classifier: Topic :: Text Processing
27
+ Classifier: Topic :: System :: Filesystems
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/markdown
30
+ Requires-Dist: numpy>=1.20.0
31
+ Requires-Dist: pandas>=1.3.0
32
+ Requires-Dist: sqlalchemy>=1.4.0
33
+ Requires-Dist: seleniumbase>=4.0.0
34
+ Requires-Dist: selenium>=4.0.0
35
+ Requires-Dist: opencv-python>=4.5.0
36
+ Requires-Dist: matplotlib>=3.3.0
37
+ Requires-Dist: pyautogui>=0.9.50
38
+ Requires-Dist: mss>=6.0.0
39
+ Requires-Dist: ipython>=7.0.0
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest>=6.0; extra == "dev"
42
+ Requires-Dist: pytest-cov; extra == "dev"
43
+ Requires-Dist: black; extra == "dev"
44
+ Requires-Dist: flake8; extra == "dev"
45
+ Requires-Dist: mypy; extra == "dev"
46
+ Requires-Dist: pre-commit; extra == "dev"
47
+ Provides-Extra: docs
48
+ Requires-Dist: sphinx; extra == "docs"
49
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
50
+
51
+ # qufe
52
+
53
+ A comprehensive Python utility library for data processing, file handling, database management, and automation tasks.
54
+
55
+ ## Features
56
+
57
+ ### Core Utilities (`base`)
58
+ - **Timestamp handling**: Convert timestamps to datetime objects with timezone support
59
+ - **Code comparison**: Compare code snippets with multiple diff formats (simple, unified, ndiff)
60
+ - **Dynamic module import**: Import Python modules dynamically from file paths
61
+ - **List flattening**: Flatten nested lists with configurable depth
62
+ - **Dictionary utilities**: Flatten three-level nested dictionaries with suffix support
63
+
64
+ ### Database Management (`dbhandler`)
65
+ - **PostgreSQL integration**: Easy PostgreSQL database connections and queries using SQLAlchemy
66
+ - **Database exploration**: List databases and tables with metadata
67
+ - **Connection management**: Automatic connection pooling and cleanup
68
+
69
+ ### Text Processing (`texthandler`, `excludebracket`)
70
+ - **Bracket content removal**: Remove content within brackets with validation
71
+ - **DokuWiki formatting**: Convert lists to DokuWiki table format
72
+ - **String search utilities**: Find all occurrences of substrings with context
73
+ - **Dictionary printing**: Pretty-print nested dictionaries with indentation
74
+ - **Column formatting**: Display lists in multiple columns with alignment
75
+
76
+ ### File Operations (`filehandler`)
77
+ - **Directory traversal**: Get file lists and directory trees with Unicode normalization
78
+ - **Pattern matching**: Find latest files based on datetime patterns
79
+ - **Pickle operations**: Save and load Python objects to/from pickle files
80
+ - **Path utilities**: Create unique filenames and sanitize file names
81
+ - **Content extraction**: Extract text content from directory structures
82
+
83
+ ### Data Analysis (`pdhandler`)
84
+ - **DataFrame utilities**: Convert lists to tuples in pandas DataFrames
85
+ - **Column analysis**: Compare column names across multiple DataFrames
86
+ - **Missing data detection**: Find rows and columns with NA or empty values
87
+ - **Data validation**: Comprehensive data quality checks
88
+
89
+ ### Automation & Screen Interaction (`interactionhandler`)
90
+ - **Screen capture**: Take screenshots of full screen or specific regions
91
+ - **Image processing**: Color detection, image comparison, and difference highlighting
92
+ - **Mouse automation**: Random clicking within regions for automation
93
+ - **Progress tracking**: Real-time progress updates in Jupyter notebooks
94
+ - **Color analysis**: Extract and analyze color codes from screen regions
95
+
96
+ ### Web Browser Automation (`wbhandler`)
97
+ - **SeleniumBase integration**: Enhanced browser automation with custom timeouts
98
+ - **Network monitoring**: Capture fetch/XHR requests with JavaScript injection
99
+ - **Element discovery**: Interactive element finding with common attribute detection
100
+ - **URL parsing**: Extract parameters and values from URLs
101
+ - **Multi-browser support**: Chrome and Firefox browser implementations
102
+
103
+ ## Installation
104
+
105
+ ```bash
106
+ pip install qufe
107
+ ```
108
+
109
+ ## Quick Start
110
+
111
+ ### Basic Usage
112
+
113
+ ```python
114
+ from qufe import base, texthandler, filehandler
115
+
116
+ # Timestamp handling
117
+ ts = base.TS('Asia/Seoul')
118
+ formatted_time = ts.get_ts_formatted(1640995200)
119
+
120
+ # File operations
121
+ fh = filehandler.FileHandler()
122
+ files = fh.get_tree('/path/to/directory')
123
+
124
+ # Text processing
125
+ texthandler.print_dict({'key': ['value1', 'value2']})
126
+ ```
127
+
128
+ ### Database Operations
129
+
130
+ ```python
131
+ from qufe.dbhandler import PostGreSQLHandler
132
+
133
+ # Connect to PostgreSQL
134
+ db = PostGreSQLHandler('my_database')
135
+ databases = db.get_db_list()
136
+ tables = db.get_table_list()
137
+ ```
138
+
139
+ ### Screen Automation
140
+
141
+ ```python
142
+ from qufe.interactionhandler import get_sc, display_img
143
+
144
+ # Capture screen
145
+ screenshot = get_sc(100, 100, 800, 600)
146
+ display_img(screenshot, is_bgra=True)
147
+ ```
148
+
149
+ ### Web Browser Automation
150
+
151
+ ```python
152
+ from qufe.wbhandler import FireFox
153
+
154
+ # Start browser session
155
+ browser = FireFox()
156
+ browser.sb.open('https://example.com')
157
+ browser.inject_capture_with_js()
158
+ logs = browser.get_capture()
159
+ browser.quit_driver()
160
+ ```
161
+
162
+ ## Requirements
163
+
164
+ - Python 3.8+
165
+ - pandas >= 1.3.0
166
+ - numpy >= 1.20.0
167
+ - sqlalchemy >= 1.4.0
168
+ - seleniumbase >= 4.0.0
169
+ - opencv-python >= 4.5.0
170
+ - matplotlib >= 3.3.0
171
+ - pyautogui >= 0.9.50
172
+ - mss >= 6.0.0
173
+
174
+ ## License
175
+
176
+ MIT License
177
+
178
+ ## Contributing
179
+
180
+ Contributions are welcome! Please feel free to submit a Pull Request.
181
+
182
+ ## Security & Ethics
183
+
184
+ ### Database Configuration
185
+ For security, database credentials should be provided via environment variables:
186
+ ```bash
187
+ export POSTGRES_USER=your_username
188
+ export POSTGRES_PASSWORD=your_password
189
+ export POSTGRES_HOST=localhost
190
+ export POSTGRES_PORT=5432
191
+ export POSTGRES_DB=your_database
192
+ ```
193
+
194
+ ### Automation Guidelines
195
+ When using screen capture and browser automation features:
196
+ - Respect website terms of service and robots.txt
197
+ - Be mindful of rate limiting and server load
198
+ - Only automate interactions you're authorized to perform
199
+ - Consider privacy implications of screen capture functionality
200
+
201
+ ### Web Scraping Ethics
202
+ - Always check and comply with robots.txt
203
+ - Respect rate limits and implement delays
204
+ - Review website terms of service before scraping
205
+ - Be considerate of server resources
206
+
207
+ ## Support
208
+
209
+ If you encounter any problems, please file an issue along with a detailed description.
qufe-0.1.2/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # qufe
2
+
3
+ A comprehensive Python utility library for data processing, file handling, database management, and automation tasks.
4
+
5
+ ## Features
6
+
7
+ ### Core Utilities (`base`)
8
+ - **Timestamp handling**: Convert timestamps to datetime objects with timezone support
9
+ - **Code comparison**: Compare code snippets with multiple diff formats (simple, unified, ndiff)
10
+ - **Dynamic module import**: Import Python modules dynamically from file paths
11
+ - **List flattening**: Flatten nested lists with configurable depth
12
+ - **Dictionary utilities**: Flatten three-level nested dictionaries with suffix support
13
+
14
+ ### Database Management (`dbhandler`)
15
+ - **PostgreSQL integration**: Easy PostgreSQL database connections and queries using SQLAlchemy
16
+ - **Database exploration**: List databases and tables with metadata
17
+ - **Connection management**: Automatic connection pooling and cleanup
18
+
19
+ ### Text Processing (`texthandler`, `excludebracket`)
20
+ - **Bracket content removal**: Remove content within brackets with validation
21
+ - **DokuWiki formatting**: Convert lists to DokuWiki table format
22
+ - **String search utilities**: Find all occurrences of substrings with context
23
+ - **Dictionary printing**: Pretty-print nested dictionaries with indentation
24
+ - **Column formatting**: Display lists in multiple columns with alignment
25
+
26
+ ### File Operations (`filehandler`)
27
+ - **Directory traversal**: Get file lists and directory trees with Unicode normalization
28
+ - **Pattern matching**: Find latest files based on datetime patterns
29
+ - **Pickle operations**: Save and load Python objects to/from pickle files
30
+ - **Path utilities**: Create unique filenames and sanitize file names
31
+ - **Content extraction**: Extract text content from directory structures
32
+
33
+ ### Data Analysis (`pdhandler`)
34
+ - **DataFrame utilities**: Convert lists to tuples in pandas DataFrames
35
+ - **Column analysis**: Compare column names across multiple DataFrames
36
+ - **Missing data detection**: Find rows and columns with NA or empty values
37
+ - **Data validation**: Comprehensive data quality checks
38
+
39
+ ### Automation & Screen Interaction (`interactionhandler`)
40
+ - **Screen capture**: Take screenshots of full screen or specific regions
41
+ - **Image processing**: Color detection, image comparison, and difference highlighting
42
+ - **Mouse automation**: Random clicking within regions for automation
43
+ - **Progress tracking**: Real-time progress updates in Jupyter notebooks
44
+ - **Color analysis**: Extract and analyze color codes from screen regions
45
+
46
+ ### Web Browser Automation (`wbhandler`)
47
+ - **SeleniumBase integration**: Enhanced browser automation with custom timeouts
48
+ - **Network monitoring**: Capture fetch/XHR requests with JavaScript injection
49
+ - **Element discovery**: Interactive element finding with common attribute detection
50
+ - **URL parsing**: Extract parameters and values from URLs
51
+ - **Multi-browser support**: Chrome and Firefox browser implementations
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ pip install qufe
57
+ ```
58
+
59
+ ## Quick Start
60
+
61
+ ### Basic Usage
62
+
63
+ ```python
64
+ from qufe import base, texthandler, filehandler
65
+
66
+ # Timestamp handling
67
+ ts = base.TS('Asia/Seoul')
68
+ formatted_time = ts.get_ts_formatted(1640995200)
69
+
70
+ # File operations
71
+ fh = filehandler.FileHandler()
72
+ files = fh.get_tree('/path/to/directory')
73
+
74
+ # Text processing
75
+ texthandler.print_dict({'key': ['value1', 'value2']})
76
+ ```
77
+
78
+ ### Database Operations
79
+
80
+ ```python
81
+ from qufe.dbhandler import PostGreSQLHandler
82
+
83
+ # Connect to PostgreSQL
84
+ db = PostGreSQLHandler('my_database')
85
+ databases = db.get_db_list()
86
+ tables = db.get_table_list()
87
+ ```
88
+
89
+ ### Screen Automation
90
+
91
+ ```python
92
+ from qufe.interactionhandler import get_sc, display_img
93
+
94
+ # Capture screen
95
+ screenshot = get_sc(100, 100, 800, 600)
96
+ display_img(screenshot, is_bgra=True)
97
+ ```
98
+
99
+ ### Web Browser Automation
100
+
101
+ ```python
102
+ from qufe.wbhandler import FireFox
103
+
104
+ # Start browser session
105
+ browser = FireFox()
106
+ browser.sb.open('https://example.com')
107
+ browser.inject_capture_with_js()
108
+ logs = browser.get_capture()
109
+ browser.quit_driver()
110
+ ```
111
+
112
+ ## Requirements
113
+
114
+ - Python 3.8+
115
+ - pandas >= 1.3.0
116
+ - numpy >= 1.20.0
117
+ - sqlalchemy >= 1.4.0
118
+ - seleniumbase >= 4.0.0
119
+ - opencv-python >= 4.5.0
120
+ - matplotlib >= 3.3.0
121
+ - pyautogui >= 0.9.50
122
+ - mss >= 6.0.0
123
+
124
+ ## License
125
+
126
+ MIT License
127
+
128
+ ## Contributing
129
+
130
+ Contributions are welcome! Please feel free to submit a Pull Request.
131
+
132
+ ## Security & Ethics
133
+
134
+ ### Database Configuration
135
+ For security, database credentials should be provided via environment variables:
136
+ ```bash
137
+ export POSTGRES_USER=your_username
138
+ export POSTGRES_PASSWORD=your_password
139
+ export POSTGRES_HOST=localhost
140
+ export POSTGRES_PORT=5432
141
+ export POSTGRES_DB=your_database
142
+ ```
143
+
144
+ ### Automation Guidelines
145
+ When using screen capture and browser automation features:
146
+ - Respect website terms of service and robots.txt
147
+ - Be mindful of rate limiting and server load
148
+ - Only automate interactions you're authorized to perform
149
+ - Consider privacy implications of screen capture functionality
150
+
151
+ ### Web Scraping Ethics
152
+ - Always check and comply with robots.txt
153
+ - Respect rate limits and implement delays
154
+ - Review website terms of service before scraping
155
+ - Be considerate of server resources
156
+
157
+ ## Support
158
+
159
+ If you encounter any problems, please file an issue along with a detailed description.
@@ -0,0 +1,99 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "qufe"
7
+ version = "0.1.2"
8
+ description = "A comprehensive Python utility library for data processing, file handling, database management, and automation tasks"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Bongtae Jeon", email = "bongtae.jeon@gmail.com"}
13
+ ]
14
+ maintainers = [
15
+ {name = "Bongtae Jeon", email = "bongtae.jeon@gmail.com"}
16
+ ]
17
+ keywords = [
18
+ "utilities",
19
+ "automation",
20
+ "data-processing",
21
+ "database",
22
+ "file-handling",
23
+ "web-scraping",
24
+ "image-processing"
25
+ ]
26
+ classifiers = [
27
+ "Development Status :: 4 - Beta",
28
+ "Intended Audience :: Developers",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Operating System :: OS Independent",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.8",
33
+ "Programming Language :: Python :: 3.9",
34
+ "Programming Language :: Python :: 3.10",
35
+ "Programming Language :: Python :: 3.11",
36
+ "Programming Language :: Python :: 3.12",
37
+ "Topic :: Software Development :: Libraries :: Python Modules",
38
+ "Topic :: Utilities",
39
+ "Topic :: Database",
40
+ "Topic :: Text Processing",
41
+ "Topic :: System :: Filesystems"
42
+ ]
43
+ requires-python = ">=3.8"
44
+ dependencies = [
45
+ "numpy>=1.20.0",
46
+ "pandas>=1.3.0",
47
+ "sqlalchemy>=1.4.0",
48
+ "seleniumbase>=4.0.0",
49
+ "selenium>=4.0.0",
50
+ "opencv-python>=4.5.0",
51
+ "matplotlib>=3.3.0",
52
+ "pyautogui>=0.9.50",
53
+ "mss>=6.0.0",
54
+ "ipython>=7.0.0"
55
+ ]
56
+
57
+ [project.optional-dependencies]
58
+ dev = [
59
+ "pytest>=6.0",
60
+ "pytest-cov",
61
+ "black",
62
+ "flake8",
63
+ "mypy",
64
+ "pre-commit"
65
+ ]
66
+ docs = [
67
+ "sphinx",
68
+ "sphinx-rtd-theme"
69
+ ]
70
+
71
+ [project.urls]
72
+ Homepage = "https://dev.qufe.net/"
73
+ Repository = "https://github.com/qufe/qufe"
74
+ Documentation = "https://qufe.readthedocs.io"
75
+ "Bug Tracker" = "https://github.com/qufe/qufe/issues"
76
+
77
+ [tool.setuptools.packages.find]
78
+ where = ["src"]
79
+ include = ["qufe*"]
80
+ exclude = ["tests*", "docs*"]
81
+
82
+ [tool.setuptools.package-data]
83
+ qufe = ["py.typed"]
84
+
85
+ [tool.black]
86
+ line-length = 88
87
+ target-version = ['py38']
88
+
89
+ [tool.mypy]
90
+ python_version = "3.8"
91
+ warn_return_any = true
92
+ warn_unused_configs = true
93
+ disallow_untyped_defs = true
94
+
95
+ [tool.pytest.ini_options]
96
+ testpaths = ["tests"]
97
+ python_files = ["test_*.py"]
98
+ python_classes = ["Test*"]
99
+ python_functions = ["test_*"]
qufe-0.1.2/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,56 @@
1
+ """
2
+ qufe - A comprehensive Python utility library
3
+
4
+ A collection of utilities for data processing, file handling, database management,
5
+ automation tasks, and more.
6
+ """
7
+
8
+ __version__ = "0.1.2"
9
+ __author__ = "Bongtae Jeon"
10
+ __email__ = "bongtae.jeon@gmail.com"
11
+
12
+ # Import main classes and functions for easy access
13
+ from . import base
14
+ from . import dbhandler
15
+ from . import excludebracket
16
+ from . import filehandler
17
+ from . import interactionhandler
18
+ from . import pdhandler
19
+ from . import texthandler
20
+ from . import wbhandler
21
+
22
+ # Commonly used classes and functions
23
+ from .base import TS, diff_codes, import_script, flatten, flatten_gen
24
+ from .filehandler import FileHandler, PathFinder
25
+ from .dbhandler import PostGreSQLHandler
26
+ from .texthandler import print_dict, print_in_columns, list_to_doku_wiki_table
27
+ from .excludebracket import eb2, check_eb
28
+
29
+ __all__ = [
30
+ # Modules
31
+ 'base',
32
+ 'dbhandler',
33
+ 'excludebracket',
34
+ 'filehandler',
35
+ 'interactionhandler',
36
+ 'pdhandler',
37
+ 'texthandler',
38
+ 'wbhandler',
39
+
40
+ # Classes
41
+ 'TS',
42
+ 'FileHandler',
43
+ 'PathFinder',
44
+ 'PostGreSQLHandler',
45
+
46
+ # Functions
47
+ 'diff_codes',
48
+ 'import_script',
49
+ 'flatten',
50
+ 'flatten_gen',
51
+ 'print_dict',
52
+ 'print_in_columns',
53
+ 'list_to_doku_wiki_table',
54
+ 'eb2',
55
+ 'check_eb',
56
+ ]