@@ -59,8 +59,6 @@ Parameters
59
59
* `dest`: Destination folder for downloaded filings
60
60
* `download_rate`: Number of filings to download every second (limit=10)
61
61
* `skip_file`: If true, existing files will be skipped
62
- * `pbar`: ProgressBar (Term.jl)
63
- * `stop_pbar`: If false, progress bar will not be stopped
64
62
* `pbar_desc`: pbar Description
65
63
* `runnings_tests`: If true, only downloads one file
66
64
* `clean_text`: function to clean text before writing to file
@@ -70,8 +68,6 @@ function download_filings(
70
68
dest= " ./data/" :: String ,
71
69
download_rate= 10 :: Int ,
72
70
skip_file= true :: Bool ,
73
- pbar= ProgressBar (;):: ProgressBar ,
74
- stop_pbar= true :: Bool ,
75
71
pbar_desc= " Downloading Filings" :: String ,
76
72
running_tests= false :: Bool ,
77
73
clean_text:: Function = _pass_text,
@@ -100,24 +96,20 @@ function download_filings(
100
96
return nothing
101
97
end
102
98
103
- job = addjob! (pbar; N= size (filenames, 1 ), description= pbar_desc)
104
- start! (pbar)
99
+ p = Progress (size (filenames, 1 ); desc= pbar_desc)
105
100
for file in filenames
106
101
full_file = joinpath (dest, replace (file, " edgar/data/" => " " ))
107
102
108
103
@async download_filing (file, full_file, dest; clean_text)
109
104
110
- update! (job )
105
+ next! (p )
111
106
sleep (sleep_time)
112
- render (pbar)
113
107
114
108
if running_tests
115
109
break
116
110
end
117
111
end
118
- if stop_pbar
119
- stop! (pbar)
120
- end
112
+ finish! (p)
121
113
122
114
return nothing
123
115
end
@@ -146,8 +138,6 @@ Parameters
146
138
* `filing_types`: Types of filings to download (eg. ["10-K", "10-Q"])
147
139
* `download_rate`: Number of filings to download every second (limit=10)
148
140
* `skip_file`: If true, existing files will be skipped
149
- * `pbar`: ProgressBar (Term.jl)
150
- * `stop_pbar`: If false, progress bar will not be stopped
151
141
* `pbar_desc`: pbar Description
152
142
* `runnings_tests`: If true, only downloads one file
153
143
* `clean_text`: function to clean text before writing to file
@@ -158,8 +148,6 @@ function download_filings(
158
148
filing_types= [" 10-K" ]:: Vector{String} ,
159
149
download_rate= 10 :: Int ,
160
150
skip_file= true :: Bool ,
161
- pbar= ProgressBar (;):: ProgressBar ,
162
- stop_pbar= true :: Bool ,
163
151
pbar_desc= " Downloading Filings" :: String ,
164
152
running_tests= false :: Bool ,
165
153
clean_text:: Function = _pass_text,
@@ -185,8 +173,6 @@ function download_filings(
185
173
dest= dest,
186
174
download_rate= download_rate,
187
175
skip_file= skip_file,
188
- pbar= pbar,
189
- stop_pbar= stop_pbar,
190
176
pbar_desc= pbar_desc,
191
177
running_tests= running_tests,
192
178
clean_text,
@@ -261,12 +247,7 @@ function download_filings(
261
247
dest= metadata_dest,
262
248
skip_file= skip_metadata_file,
263
249
)
264
-
265
- pbar = ProgressBar (; columns= progress_bar_columns)
266
- job = addjob! (
267
- pbar; N= size (time_periods, 1 ), description= " Iterating Over Time Periods..."
268
- )
269
- start! (pbar)
250
+ p = Progress (size (time_periods, 1 ); desc= " Iterating Over Time Periods..." )
270
251
for t in time_periods
271
252
file = joinpath (metadata_dest, string (t[1 ]) * " -QTR" * string (t[2 ]) * " .tsv" )
272
253
download_filings (
@@ -275,16 +256,13 @@ function download_filings(
275
256
filing_types= filing_types,
276
257
download_rate= download_rate,
277
258
skip_file= skip_file,
278
- pbar= pbar,
279
- stop_pbar= false ,
280
259
pbar_desc= " Downloading $(t[1 ]) Q$(t[2 ]) Filings" ,
281
260
running_tests= running_tests,
282
261
clean_text,
283
262
)
284
- update! (job)
285
- render (pbar)
263
+ next! (p)
286
264
end
287
- stop! (pbar )
265
+ finish! (p )
288
266
289
267
return nothing
290
268
end
0 commit comments