Last active
February 27, 2026 16:01
-
-
Save mmssr/d7c9d14019793d0665810c2e40a3ab90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## requires https://pypi.org/project/numbers-parser/ | |
| ## quick convert apple numbers format to csv | |
| from numbers_parser import Document | |
| import csv | |
| import sys | |
| import os | |
| def numbers_to_csv(input_file, output_file): | |
| doc = Document(input_file) | |
| sheet = doc.sheets[0] | |
| table = sheet.tables[0] | |
| rows = table.rows(values_only=True) | |
| with open(output_file, "w", newline="", encoding="utf-8") as f: | |
| writer = csv.writer(f) | |
| for row in rows: | |
| writer.writerow(["" if v is None else v for v in row]) | |
| print(f"CSV created: {output_file}") | |
| if __name__ == "__main__": | |
| if len(sys.argv) < 3: | |
| print("Usage: python numbers_to_csv.py INPUT.numbers OUTPUT.csv") | |
| sys.exit(1) | |
| input_file = sys.argv[1] | |
| output_file = sys.argv[2] | |
| numbers_to_csv(input_file, output_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment