()
| 218 | |
| 219 | |
| 220 | def main(): |
| 221 | with open(INDEX_PATH, "r", encoding="utf-8") as f: |
| 222 | index = json.load(f) |
| 223 | |
| 224 | entries = index.get("entries", []) |
| 225 | print(f"IMDRF Index: {len(entries)} entries") |
| 226 | print(f"Output dir: {OUTPUT_DIR}") |
| 227 | OUTPUT_DIR.mkdir(parents=True, exist_ok=True) |
| 228 | |
| 229 | success = 0 |
| 230 | skipped = 0 |
| 231 | failed = 0 |
| 232 | |
| 233 | for entry in entries: |
| 234 | result = process_entry(entry) |
| 235 | if result is True: |
| 236 | success += 1 |
| 237 | time.sleep(2) |
| 238 | elif result is False: |
| 239 | if (OUTPUT_DIR / f"{entry['id']}.md").exists(): |
| 240 | skipped += 1 |
| 241 | else: |
| 242 | failed += 1 |
| 243 | |
| 244 | print(f"\nDone: {success} converted, {skipped} skipped, {failed} failed") |
| 245 | |
| 246 | |
| 247 | if __name__ == "__main__": |
no test coverage detected