-
Notifications
You must be signed in to change notification settings - Fork 0
/
commons2stocks.py
34 lines (20 loc) · 902 Bytes
/
commons2stocks.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
import logging
import argparse
import sys
from fileprocessor import Fileprocessor
fileprocessor = Fileprocessor()
parser = argparse.ArgumentParser(
description="Download photo from Commons, read wikidata objects, generate IPTC tags for photostock upload "
)
parser.add_argument("url",help='URL of Wikimedia commons file')
parser.add_argument("-с", "--city", type=str, required=True, help='City object, wikidata id or wikidata name')
parser.add_argument("-dry", "--dry-run", action="store_const",
required=False, default=False, const=True)
parser.add_argument("--date", type=str, required=False, help='use YYYY-MM-DD date if can not read from EXIF')
args = parser.parse_args()
#open commons file
fileprocessor.commons2stock_dev(args.url, args.city, dry_run = args.dry_run, date=args.date)