https://github.com/kaledoux/flashcard_json_maker
Elixir program to simplify the creation of json formatted data used with bsyjpncards.org
https://github.com/kaledoux/flashcard_json_maker
Last synced: about 1 month ago
JSON representation
Elixir program to simplify the creation of json formatted data used with bsyjpncards.org
- Host: GitHub
- URL: https://github.com/kaledoux/flashcard_json_maker
- Owner: kaledoux
- Created: 2022-02-28T19:40:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-14T22:12:47.000Z (over 4 years ago)
- Last Synced: 2025-02-26T21:13:35.267Z (over 1 year ago)
- Language: Elixir
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FlashcardJsonMaker
## Summary
A simple application for quickly adding more flashcard data to an exiting JSON data file; this was built with the [flashcard app](https://github.com/EdgeCaseBerg/bsyjpncards.org) by EdgeCaseBerg in mind, specifically.
This app will read a source JSON file and a source CSV file with flashcard additions, and create a new temp file with the CSV rows converted to JSON and appended to the original.
You can verify additions in the temp and then replace the source JSON file.
## Installation
No install is necessary beyond cloning the repo and making sure you have Erlang runtime and Elixir ~> 1.13 in your runtime environment.
## Running the Program
Simply run `mix start` and the program will start.
## How it works
The program works on the basis of a source JSON file, a source CSV file, and newly created "temp" file. You will need to specify a file directory for all three within your CLI.
The program will ask you to provide a new file location for the "temp" file, then the source JSON file location, followed by the source CSV location.
Remember **the locations you provide are relative to the directory in which you are running the program** so take care to reference properly.
### CSV Formatting
The program assumes that data in the CSV will be formatted in the following pattern:
```
kanji,fronttext,backtext,source,page(optional)
```
So an example might look like so:
```
true,明日,tomorrow,book1,
true,上,over,book1,
false,どこも,nowhere or everywhere,book2,3
```
Note that the `page` attribute does not need to be present, but the comma that delineates the `source` and `page` *is required*.
Bear in mind that each row must be separated by a newline (`\n`).
## Invalid File Location
The program will crash out if you specify a JSON or CSV source location that does not exist.
## Temp file Overwrite
**Be careful naming your temp file as it will overwrite any file of the same name**