@@ -4,7 +4,7 @@ Python module to ease writing scripts go over big amount of data in order to per
4
4
Will elaborate more when it will get mature enough :)
5
5
6
6
# capabilities
7
- #####PyHacks
7
+ ##### PyHacks
8
8
Using all below capabilities to easily manage threads and queue to perform operations on Item objects.
9
9
10
10
@@ -39,15 +39,15 @@ if __name__ == "__main__":
39
39
```
40
40
41
41
42
- #####QueueThreads
42
+ ##### QueueThreads
43
43
QueueThreads class allows you to manage queue and threads easily.
44
44
``` python
45
45
qt = QueueThreads(handle_function, num_worker_threads, logger)
46
46
qt.put({" counter" :1 , " key1" :" value1" })
47
47
qt.finish() # waiting until job is finished
48
48
```
49
49
50
- ######parameters
50
+ ###### parameters
51
51
handle_function - a function recevies item parameter from queue, will be used in all threads defined, return value has to be bool
52
52
``` python
53
53
def handle_item (item ):
@@ -67,7 +67,7 @@ def handle_item(item):
67
67
num_worker_threads - numbers of threads used to run handle_functions on queue items
68
68
logger - a Logger instance to be used for automatic logging
69
69
70
- #####Parser
70
+ ##### Parser
71
71
Parse files and returns list of Item objects
72
72
``` python
73
73
parse = Parser()
@@ -77,7 +77,7 @@ for item in items:
77
77
```
78
78
79
79
80
- #####Logger
80
+ ##### Logger
81
81
Easy logging mechanism + writing into files under logs directory, used by QueueThreads for autoamtic logging
82
82
``` python
83
83
logger = Logger(verbose = False )
@@ -86,7 +86,7 @@ logger.red("text")
86
86
logger.yellow(" text" )
87
87
```
88
88
89
- #####Exporter
89
+ ##### Exporter
90
90
Exporting Item objects into a csv/txt file
91
91
92
92
``` python
0 commit comments