-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun_flow.py
More file actions
37 lines (32 loc) · 1.04 KB
/
run_flow.py
File metadata and controls
37 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import sys
from src.config import SCRAPING_MODE, SCRAPING_MONTH, SCRAPING_TARGET, SCRAPING_YEAR
from src.flows.decp_processing import decp_processing
from src.flows.get_cog import get_cog
from src.flows.scrap import scrap
from src.flows.sirene_preprocess import sirene_preprocess
FUNCTIONS = {
"sirene_preprocess": sirene_preprocess,
"decp_processing": decp_processing,
"get_cog": get_cog,
"scrap": scrap,
}
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python flows.py <function_name>")
print("Available functions:", list(FUNCTIONS.keys()))
sys.exit(1)
func_name = sys.argv[1]
if func_name not in FUNCTIONS:
print(f"Unknown function: {func_name}")
print("Available functions:", list(FUNCTIONS.keys()))
sys.exit(1)
# Call the function
if func_name != "scrap":
FUNCTIONS[func_name]()
else:
scrap(
mode=SCRAPING_MODE,
target=SCRAPING_TARGET,
month=SCRAPING_MONTH,
year=SCRAPING_YEAR,
)