aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-08 14:20:05 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-08 14:20:05 -0800
commit7e443092aee825ce30a0ffe14cd41d1e0ef3fe52 (patch)
tree7490397f6e5079986a4114b0c08ee0bd6e360e5f
parenta146ebbc3261f6cba6dc10e5a5524f6eca9ac98d (diff)
downloadfatcat-7e443092aee825ce30a0ffe14cd41d1e0ef3fe52.tar.gz
fatcat-7e443092aee825ce30a0ffe14cd41d1e0ef3fe52.zip
partial fixes to fatcat_export.py
-rwxr-xr-xpython/fatcat_export.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/python/fatcat_export.py b/python/fatcat_export.py
index a59fcc0b..921b75ed 100755
--- a/python/fatcat_export.py
+++ b/python/fatcat_export.py
@@ -13,7 +13,8 @@ import argparse
import fatcat_client
from fatcat_client.rest import ApiException
from fatcat_client import ReleaseEntity
-from fatcat_tools import uuid2fcid, entity_from_json, release_to_elasticsearch
+from fatcat_tools import uuid2fcid, entity_from_json, entity_to_dict, \
+ release_to_elasticsearch, public_api
def run_export_releases(args):
@@ -21,7 +22,8 @@ def run_export_releases(args):
for line in args.ident_file:
ident = uuid2fcid(line.split()[0])
release = api.get_release(id=ident, expand="all")
- args.json_output.write(json.dumps(release.to_dict()) + "\n")
+ args.json_output.write(
+ json.dumps(entity_to_dict(release)) + "\n")
def run_transform_releases(args):
for line in args.json_input:
@@ -40,8 +42,9 @@ def run_export_changelog(args):
end = latest.index
for i in range(args.start, end):
- entry = api.get_changelog_entry(id=i)
- args.json_output.write(json.dumps(entry.to_dict()) + "\n")
+ entry = api.get_changelog_entry(index=i)
+ args.json_output.write(
+ json.dumps(entity_to_dict(entry)) + "\n")
def main():
parser = argparse.ArgumentParser()