Skip to content

Conversation

@acrowthe
Copy link
Contributor

  • Add a new python script that will:
    1. Take in a json file that was outputted by the json importable export
    2. Reorder some node properties to be in a more readable order
    3. Send the output to JSON_to_XML script

Example usage:
Run the following in cards/Utilities/JSON-to-XML:

python3 importable_json_processor.py Example.json

This will:

  • Read cards/Utilities/JSON-to-XML/Example.json
  • Write the reordered json back into Example.json
  • Output the resulting xml to cards/Utilities/JSON-to-XML/Example.xml

@acrowthe acrowthe added easy to review Very few changes, very small time investment to review low risk labels Nov 27, 2024
@marta- marta- requested a review from sashaandjic December 8, 2024 01:54
@marta- marta- added the Test me! Ready for testing label Dec 8, 2024
Base automatically changed from misc-importable-requiredsubjecttypes to dev January 2, 2025 18:39
@marta- marta- changed the title [misc] Add python scrip to reorder importable json files [misc] Add python script to reorder importable json files Jan 6, 2025
- Add a new python script that will:
  1. Take in a json file that was outputted by the json importable export
  2. Reorder some node properties to be in a more readable order
  3. Send the output to JSON_to_XML script

Example usage:
Run the following in cards/Utilities/JSON-to-XML:
```
python3 importable_json_processor.py Example.json
```
This will:
- Read cards/Utilities/JSON-to-XML/Example.json
- Write the reordered json back into Example.json
- Output the resulting xml to cards/Utilities/JSON-to-XML/Example.xml
@acrowthe acrowthe force-pushed the misc-importable-processor-order branch from 5399d24 to d5c5835 Compare November 21, 2025 15:50
@acrowthe
Copy link
Contributor Author

Retested, still works

Copy link
Member

@sdumitriu sdumitriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work very well when the script and the json are in different parts. Suggestions:

  • when invoking json_to_xml.py, use dirname of current executable) as the base path instead of ../
  • in json_to_xml.py, the name of the root node should be basename of xml_name instead of the whole xml_name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

easy to review Very few changes, very small time investment to review low risk Test me! Ready for testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants