-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from Materials-Data-Science-and-Informatics/fi…
…x/non_ascii json dumps wont force ascii characters
- Loading branch information
Showing
9 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
], | ||
"name": "somesy", | ||
"description": "A CLI tool for synchronizing software project metadata.", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"keywords": [ | ||
"metadata", | ||
"FAIR" | ||
|
@@ -62,7 +62,7 @@ | |
{ | ||
"@type": "Person", | ||
"givenName": "Jens", | ||
"familyName": "Br\u00f6der", | ||
"familyName": "Bröder", | ||
"email": "[email protected]", | ||
"@id": "https://orcid.org/0000-0001-7939-226X" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Integration with codemetapy (to re-generate codemeta as part of somesy sync).""" | ||
"""Integration with codemeta.json (to re-generate codemeta as part of somesy sync).""" | ||
from .writer import Codemeta | ||
|
||
__all__ = ["Codemeta"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Utility functions for somesy.""" | ||
import json | ||
|
||
import wrapt | ||
|
||
|
||
@wrapt.decorator | ||
def json_dump_wrapper(wrapped, instance, args, kwargs): | ||
"""Wrap json.dump to write non-ascii characters with default indentation.""" | ||
# Ensure ensure_ascii is set to False | ||
kwargs["ensure_ascii"] = False | ||
# set indent to 2 if not set | ||
kwargs["indent"] = kwargs.get("indent", 2) | ||
return wrapped(*args, **kwargs) | ||
|
||
|
||
# Apply the wrapper | ||
json.dump = json_dump_wrapper(json.dump) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters