Search the DnD5e API and return relevant information
- Python ^3.7
- appdirs>=1.4.4 for finding what directories to store data in (helps this function as a platform-independent application)
- GitPython>=3.1.14 for downloading the database repository
- pymongo>=3.11.3 for querying a local database
- requests>=2.25.1 for querying the database at https://dnd5eapi.co/api
- rich>=9.13.0 for formatting retrieved information
- If you want to query a local database (it's faster and works offline!),
install
mongodb
and make sure it's running on the default host and port.
dnfo
takes an argument for an endpoint and an index of that endpoint, in the
format of python3 dnfo \[endpoint] \[index]
. To get available
endpoints, run the command with no arguments,
or a help flag (-h|--help|help
).
To get available indexes of an endpoint, run the command without an index:
python3 dnfo \[endpoint]
.
- Make sure
mongod
is running on the default host and port. - Run
dnfo --build
to build the database used by the DnD 5th Edition API. - Run
dnfo
with the--local
flag to use the local database instead of the online API.
Coming soon...
- Tests
- Formatting of dictionaries as values in a dict
- If disconnected from internet and database is built, use the db
- Config file
- Configurable host and port for mongo database
- Store responses in a database
- Populate the database and create a .lock file, with a regeneration if requested by the user
- Print rows that fit the size of the command prompt
- Store all options in arrays and check arguments against them
- Format all received data in a rich Table