Skip to content

Commit

Permalink
updating to allow save of unicode and dont check users that already h…
Browse files Browse the repository at this point in the history
…ave orcid (#44)

Signed-off-by: vsoch <vsochat@stanford.edu>
  • Loading branch information
vsoch committed Jul 30, 2020
1 parent 1473a0f commit abc7308
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
The versions coincide with releases on pip.

## [0.0.x](https://github.com/con/tributors/tree/master) (0.0.x)
- unicode characters allowed, and dont update users with orcids (0.0.16)
- should allow for repository names with .git extension (0.0.15)
- adding support to do updates `--from` (between) resources (0.0.14)
- adding github to update-lookup, not doing by default (0.0.13)
Expand Down
3 changes: 3 additions & 0 deletions tributors/main/parsers/zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ def update_orcids(self):
"""
creators = []
for user in self.data.get("creators", []):
orcid = user.get("orcid")
name = user.get("name")
email = user.get("email")
if orcid is not None:
continue
if email or name and self.orcid_token is not None:
orcid = get_orcid(email=email, token=self.orcid_token, name=name)
if orcid:
Expand Down
10 changes: 7 additions & 3 deletions tributors/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ def write_json(json_obj, filename, pretty=True):
- json_obj (dict) : the dict to print to json
- filename (str) : the output file to write to
"""
with open(filename, "w") as filey:
with open(filename, "w", encoding="utf8") as filey:
if pretty:
filey.writelines(json.dumps(json_obj, indent=4, separators=(",", ": ")))
filey.writelines(
json.dumps(
json_obj, indent=4, ensure_ascii=False, separators=(",", ": ")
)
)
else:
filey.writelines(json.dumps(json_obj))
filey.writelines(json.dumps(json_obj), ensure_ascii=False)
return filename


Expand Down
2 changes: 1 addition & 1 deletion tributors/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

__version__ = "0.0.15"
__version__ = "0.0.16"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsochat@stanford.edu"
NAME = "tributors"
Expand Down

0 comments on commit abc7308

Please sign in to comment.