Add CircleMUD parser, multi-format support, and normalized JSON output#4
Open
daiverd wants to merge 9 commits intoctoth:masterfrom
Open
Add CircleMUD parser, multi-format support, and normalized JSON output#4daiverd wants to merge 9 commits intoctoth:masterfrom
daiverd wants to merge 9 commits intoctoth:masterfrom
Conversation
- New circlemud.py module for parsing CircleMUD split-file format - Supports .wld, .mob, .obj, .zon, .shp files - Handles alphanumeric VNUMs (e.g., QQ00, XX74) - Same API pattern as existing parsers (load_sections, as_dict, as_json) - Update README with CircleMUD usage and output format documentation
- Add RotMob and RotAreaFile for Realms of Thera format - Add SmaugWdAreaFile with SmaugWdMob, SmaugWdItem, SmaugWdRoom, SmaugWdReset - Fix +- number pattern handling (negative after plus) - Fix VNum type handling in reader - Add section handlers: areadata, resetmsg, author, ranges, flags - Fix Reset/MercReset arg parsing for M, P, G, R commands - Add convert_all.py batch conversion script - Add validate_samples.py for testing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add EnvyAreaFile, EnvyMob, EnvyItem, EnvyRoom classes for Envy format - Normalize CRLF to LF on file load to handle Windows line endings - Add read_dice_or_number() for flexible dice/number parsing - Add read_to_blank_line() for multi-line descriptions without tildes - Fix Envy object extra descriptions (single-line, no tilde terminator) - Fix Envy room extra descriptions (use standard tilde terminator) - Add S marker handling for room termination - Fix exits serialization (convert OrderedDict to list) - Update convert_all.py with Envy format detection and parser order Converts 11 additional Envy files (192 total success, up from 181). Remaining 6 Envy failures due to format variants or data corruption. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix read_until() to detect missing terminators and raise ParseError instead of setting index to -1 and looping infinitely - Add MOBprog (>trigger....|) skipping in SmaugWdMob.read - Re-enable SMAUG-WD parser in convert_all.py Now converts 25 SMAUG-WD files (217 total success, 77.5%). Only AsylumGrounds.are fails due to malformed object missing ~. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add normalized.py with unified data classes (NormalizedMob, NormalizedItem, NormalizedRoom, NormalizedArea) for cross-format compatibility - Add normalizer.py with format-specific normalizers that convert ROM, Merc, SMAUG, Envy, and CircleMUD data to a common schema - Add --normalized/-n flag to convert_all.py for normalized output - Add --tolerant/-t flag for partial parsing when full parse fails - Add SmaugMob.read() method for proper SMAUG mob format parsing - Fix read_vnum() to properly detect section headers without consuming them - Extend EXIT_DIRECTIONS and SECTOR_TYPES enums for SMAUG compatibility - Add room prog (>) handling in Room.read_metadata() Normalized output provides unified field names and types across all MUD formats while preserving original data in the 'original' field. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add documentation for all supported formats (ROM, Merc, SMAUG, Envy, ROT, SMAUG-WD, CircleMUD) - Document normalized output format with unified schema - Add batch conversion tool (convert_all.py) usage and options - Document tolerant parsing mode for partial data extraction - Add normalized vs raw output comparison table - Add architecture section showing project structure Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive MUD area file parsing capabilities:
.wld,.mob,.obj,.zon,.shp)New Formats Supported
Normalized Output
The normalized format provides a unified schema across all MUD formats:
originalfield for lossless round-tripBatch Conversion
Key Changes
circlemud.py: New CircleMUD parsernormalized.py: Normalized data classesnormalizer.py: Format-specific normalizersconvert_all.py: Batch conversion scriptarea_reader.py: Added SmaugMob.read(), tolerant parsing, partial parse fallbackconstants.py: Extended enums for SMAUG compatibilityTest plan
🤖 Generated with Claude Code