Skip to content

Add spell lookup feature using spells.json and fix savename option - #9

Open
vkaraujo wants to merge 1 commit into
GorillaOfDestiny:mainfrom
vkaraujo:feature/lookup-spell-and-save-fix
Open

Add spell lookup feature using spells.json and fix savename option#9
vkaraujo wants to merge 1 commit into
GorillaOfDestiny:mainfrom
vkaraujo:feature/lookup-spell-and-save-fix

Conversation

@vkaraujo

Copy link
Copy Markdown

Hey, I found your project on tiktok and really loved it. I don't usually code in python, but its something i have been wanting to practice and when I saw the opportunity to contribute to something so cool I grabed it.

Thanks for the awesome project! Happy to discuss any adjustments you might want.

Summary

  • Added --lookup CLI option to search for spells inside spells.json.
  • Fetches full spell details from the D&D 5e API based on spell URL.
  • Prints detailed spell information including name, description, casting time, range, etc.
  • Fixed --savename bug (argument was parsed but not assigned), allowing users to customize output filenames.
  • Organized new logic inside a services/spell_lookup_service.py to keep writer.py clean and modular.

Reasoning

This PR implements issue #6 and improves code structure. It also prepares the project for future expansion by moving new logic into service classes.

Notes

  • Spells lookup is case-insensitive for better UX
  • Auto-handles API errors

Future Suggestions (Optional Enhancements)

While working on this contribution, I noticed a few areas that could improve user experience and project organization further:

  • Normalize user input for spell generation (e.g., case-insensitive matching, auto-trimming spaces).
    Right now, users must type exactly what's in the .txt files (case-sensitive, exact spaces). Improving this would make the CLI much more forgiving and user-friendly.

  • Automatically save generated plots into a Generated/Plots/ folder instead of the project root.

  • Add a requirements.txt file to simplify installing dependencies like numpy, matplotlib, tqdm, and requests.
    Right now, users have to guess what Python packages to install. A simple requirements.txt would make installation (pip install -r requirements.txt) much easier.

  • Continue breaking large files like writer.py into smaller modules (services, helpers, etc.) for better maintainability.

Happy to help with these in the future if you'd like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant