Read a zettel JSON file and compress it to AAAK Dialect.
(self, zettel_json_path: str, output_path: str = None)
| 775 | # === FILE-BASED COMPRESSION === |
| 776 | |
| 777 | def compress_file(self, zettel_json_path: str, output_path: str = None) -> str: |
| 778 | """Read a zettel JSON file and compress it to AAAK Dialect.""" |
| 779 | with open(zettel_json_path, "r") as f: |
| 780 | data = json.load(f) |
| 781 | dialect = self.encode_file(data) |
| 782 | if output_path: |
| 783 | with open(output_path, "w") as f: |
| 784 | f.write(dialect) |
| 785 | return dialect |
| 786 | |
| 787 | def compress_all(self, zettel_dir: str, output_path: str = None) -> str: |
| 788 | """Compress ALL zettel files into a single AAAK Dialect file.""" |
no test coverage detected