Page MenuHomeDevCentral

Utility to generate a JSON object from a tabulated file
ClosedPublic

Authored by dereckson on Jun 28 2016, 14:52.
Tags
None
Referenced Files
F34969129: D433.id1053.diff
Sat, Jul 4, 15:02
F34966594: D433.id1051.diff
Sat, Jul 4, 09:30
F34966130: D433.id1051.diff
Sat, Jul 4, 08:23
F34956720: D433.id1053.diff
Sat, Jul 4, 06:58
F34938888: D433.diff
Sat, Jul 4, 04:14
F34918362: D433.id1053.diff
Fri, Jul 3, 23:43
F34907301: D433.id1051.diff
Fri, Jul 3, 21:22
Unknown Object (File)
Fri, Jul 3, 14:01
Subscribers
None

Details

Summary

This allows to copy/paste from Excel, LibreCalc, FramaCalc, etc.
into a temporary file, then convert this key\tvalue file into a
proper JSON object representation.

Sample input:

fr\tprénom
en\tgiven name

Sample output:

{
    "fr": "prénom",
    "en": "given name"
}
Test Plan

Use jsonlint to validate JSON is well formed.

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Branch
D433
Build Status
Buildable 605
Build 721: arc lint + arc unit

Event Timeline

dereckson retitled this revision from to Utility to generate a JSON object from a tabulated file.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: Ash-Crow.

Let's add alphabetical sort, see first diff on D434 for difficulties to see where a language code is in the list.

Ash-Crow edited edge metadata.

Suggestion for alphabetical sort:

Insert at the top : import collection
Insert above the current line 21 : sorted_translations = collections.OrderedDict(sorted(translations.items()))

dereckson edited edge metadata.

flake8, alphabetical sorting, some comments

This revision is now accepted and ready to land.Jun 28 2016, 15:55