aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-02-28 01:07:48 -0800
committerPinapelz <yukais@pinapelz.com>2025-02-28 01:07:48 -0800
commit5d26d7a3f0571444f7a006b0c1be0c2bfe9912c5 (patch)
treed7ce0fcef25653c30800e2eea87aa015f0b4a7a0
parent44c02c686561e06c572c45e31639d64b992f63d1 (diff)
sdvx: add merge sdvx csv script
-rw-r--r--.gitignore3
-rw-r--r--README.md1
-rw-r--r--sdvx/eamuse_csv/README.md18
-rw-r--r--sdvx/eamuse_csv/eamuse_merge_csv.py34
-rw-r--r--sdvx/eamuse_csv/sdvx_csv_to_tachi.py (renamed from sdvx/sdvx_csv_to_tachi.py)0
5 files changed, 55 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 1800114..6e85c6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -171,4 +171,5 @@ cython_debug/
.ruff_cache/
# PyPI configuration file
-.pypirc \ No newline at end of file
+.pypirc
+.csv
diff --git a/README.md b/README.md
index 8961cf4..26c2201 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
+# more-tachi-import-scripts
Some scripts to convert from various sources to Tachi/Kamaitachi "Batch Manual" import jsons.
Use with caution as there may be some cases missing.
diff --git a/sdvx/eamuse_csv/README.md b/sdvx/eamuse_csv/README.md
new file mode 100644
index 0000000..7f9d8b3
--- /dev/null
+++ b/sdvx/eamuse_csv/README.md
@@ -0,0 +1,18 @@
+# e-amusement SDVX CSV to Tachi WARNING!!!
+The CSV provided by Konami doesn't contain any information regarding the date which you played/obtained a particular score. It only keeps your BEST score.
+
+This causes for duplicate imports if you use this script more than once
+
+## Solution
+The first time you import, run `sdvx_csv_to_tach.py` and import the output JSON file normally. Howver **KEEP THE OLD CSV FILE**
+
+The next time you play, export the CSV again but first run `eamuse_merge_csv.py --old <file> --new <file>`. Passing the old and new CSV files accordingly.
+
+This will check for differences between the 2 files and remove lines of the same value in the new file so that only newly obtained best scores are uploaded.
+
+# What if I want all plays?
+I don't think there's a method right now to automatically import arcade data into Tachi for each play. Play history is locked behind the eAmusement basic subscription plan.
+
+The best you can do is download the eAmusement app, subscribe the the basic course and manually make your own score CSV in the same format. Then run `sdvx_csv_to_tach.py`
+
+Alternatively, you can take pictures of each play result screen and build your own JSON so that there is even more info available!
diff --git a/sdvx/eamuse_csv/eamuse_merge_csv.py b/sdvx/eamuse_csv/eamuse_merge_csv.py
new file mode 100644
index 0000000..490114e
--- /dev/null
+++ b/sdvx/eamuse_csv/eamuse_merge_csv.py
@@ -0,0 +1,34 @@
+import argparse
+import csv
+
+def merge_csv(old_file: str, new_file: str):
+ old_csv_set = set()
+ new_csv_set = set()
+ encoding = "utf-8"
+ with open(old_file, encoding=encoding) as old_csv:
+ reader = csv.reader(old_csv, delimiter=",")
+ [old_csv_set.add(tuple(row)) for row in reader]
+ with open(new_file, "r", encoding=encoding) as new_csv:
+ reader = csv.reader(new_csv, delimiter=",")
+ header = next(reader)
+ [new_csv_set.add(tuple(row)) for row in reader]
+ new_csv_set = new_csv_set - old_csv_set
+
+ with open(new_file, "w", encoding=encoding, newline="") as new_csv:
+ writer = csv.writer(new_csv, delimiter=",")
+ writer.writerow(header)
+ for row in new_csv_set:
+ if row == ():
+ continue
+ writer.writerow(list(row))
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(
+ prog="eamuse_merge_to_csv",
+ description="Merges an old SDVX e-amuse CSV with a new one. Keeping only new scores in the new file",
+ )
+ parser.add_argument("--old", help="Old CSV file", required=True)
+ parser.add_argument("--new", help="New CSV file", required=True)
+ args = parser.parse_args()
+ merge_csv(args.old, args.new)
diff --git a/sdvx/sdvx_csv_to_tachi.py b/sdvx/eamuse_csv/sdvx_csv_to_tachi.py
index 5c18a73..5c18a73 100644
--- a/sdvx/sdvx_csv_to_tachi.py
+++ b/sdvx/eamuse_csv/sdvx_csv_to_tachi.py
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage