aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_harvest.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-03 12:29:39 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-03 12:31:07 -0700
commit10a2374051568edf3d872988e730328d899a0fdd (patch)
tree795be5e149a021f84bc4305c1811e63cc86f7aa1 /python/fatcat_harvest.py
parentcfab1ddcd8a05b62ecc16763d18a6ecee8fa234f (diff)
downloadfatcat-10a2374051568edf3d872988e730328d899a0fdd.tar.gz
fatcat-10a2374051568edf3d872988e730328d899a0fdd.zip
typing: first batch of python bulk type annotations
While these changes are more delicate than simple lint changes, this specific batch of edits and annotations was *relatively* simple, and resulted in few code changes other than function signature additions.
Diffstat (limited to 'python/fatcat_harvest.py')
-rwxr-xr-xpython/fatcat_harvest.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/python/fatcat_harvest.py b/python/fatcat_harvest.py
index 91356aad..be3cb888 100755
--- a/python/fatcat_harvest.py
+++ b/python/fatcat_harvest.py
@@ -19,7 +19,7 @@ from fatcat_tools.harvest import (
sentry_client = raven.Client()
-def run_crossref(args):
+def run_crossref(args: argparse.Namespace) -> None:
worker = HarvestCrossrefWorker(
kafka_hosts=args.kafka_hosts,
produce_topic=f"fatcat-{args.env}.api-crossref",
@@ -31,7 +31,7 @@ def run_crossref(args):
worker.run(continuous=args.continuous)
-def run_datacite(args):
+def run_datacite(args: argparse.Namespace) -> None:
worker = HarvestDataciteWorker(
kafka_hosts=args.kafka_hosts,
produce_topic=f"fatcat-{args.env}.api-datacite",
@@ -43,7 +43,7 @@ def run_datacite(args):
worker.run(continuous=args.continuous)
-def run_arxiv(args):
+def run_arxiv(args: argparse.Namespace) -> None:
worker = HarvestArxivWorker(
kafka_hosts=args.kafka_hosts,
produce_topic=f"fatcat-{args.env}.oaipmh-arxiv",
@@ -54,7 +54,7 @@ def run_arxiv(args):
worker.run(continuous=args.continuous)
-def run_pubmed(args):
+def run_pubmed(args: argparse.Namespace) -> None:
worker = PubmedFTPWorker(
kafka_hosts=args.kafka_hosts,
produce_topic=f"fatcat-{args.env}.ftp-pubmed",
@@ -65,7 +65,7 @@ def run_pubmed(args):
worker.run(continuous=args.continuous)
-def run_doaj_article(args):
+def run_doaj_article(args: argparse.Namespace) -> None:
worker = HarvestDoajArticleWorker(
kafka_hosts=args.kafka_hosts,
produce_topic=f"fatcat-{args.env}.oaipmh-doaj-article",
@@ -76,7 +76,7 @@ def run_doaj_article(args):
worker.run(continuous=args.continuous)
-def run_doaj_journal(args):
+def run_doaj_journal(args: argparse.Namespace) -> None:
worker = HarvestDoajJournalWorker(
kafka_hosts=args.kafka_hosts,
produce_topic=f"fatcat-{args.env}.oaipmh-doaj-journal",
@@ -87,11 +87,11 @@ def run_doaj_journal(args):
worker.run(continuous=args.continuous)
-def mkdate(raw):
+def mkdate(raw: str) -> datetime.date:
return datetime.datetime.strptime(raw, "%Y-%m-%d").date()
-def main():
+def main() -> None:
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"--kafka-hosts",