How gopal092003/dictionary-api works
Dictionary API is a local-first English dictionary service, Python client, and CLI. Users submit lookups or lexical queries through HTTP or the CLI; the service combines dictionary and relationship providers, optional offline dictionary data, caching, and local corpus or morphology features to return structured results. Separate capabilities include relationship graphs, search, random and daily words, and persistent personal vocabulary lists with import/export and flashcards. The excerpts show the HTTP routing and selected service behavior; some provider, cache, and library links rely on the source index or README rather than inspected implementation.
Main entry points: dictionary_service.py Dictionary service · dictionary.py HTTP API · cli.py Command-line interface · dictionary_api.py DictionaryAPI adapter
Components 18
User interfaces
- HTTP API
app/routes/dictionary.py - Command-line interface
app/cli.py - Python client
app/library.py - Application setup
app/main.py
Lookup orchestration
- Dictionary service
app/services/dictionary_service.py - Response models
app/models/dictionary.py - Runtime settings
app/config/settings.py - Result cache
app/cache.py
Language sources
- DictionaryAPI adapter
app/providers/dictionary_api.py - Datamuse adapter
app/providers/datamuse.py - Offline dictionary
app/providers/offline_dictionary.py - Provider HTTP transport
app/providers/http.py
Local word tools
- Word corpus
app/local_data.py - Rule-based morphology
app/morphology.py
Personal vocabulary
- Vocabulary lists
app/vocabulary.py
Other components
- User
- DictionaryAPI.dev
- Datamuse API
Connections 21
- User → HTTP API: queries
- User → Command-line interface: runs
- Application setup → HTTP API: mounts routes
app/main.py - HTTP API → Dictionary service: dispatches queries
app/routes/dictionary.py - Command-line interface → Python client: invokes
app/cli.py - Command-line interface → Vocabulary lists: manages lists
app/cli.py - Python client → Dictionary service: uses
- HTTP API → Response models: validates responses
app/routes/dictionary.py - Dictionary service → Runtime settings: configures providers
app/services/dictionary_service.py - Dictionary service → Result cache: reads and writes
app/services/dictionary_service.py - Dictionary service → DictionaryAPI adapter: looks up entries
app/services/dictionary_service.py - Dictionary service → Datamuse adapter: fetches relations
app/services/dictionary_service.py - Dictionary service → Offline dictionary: uses fallback
app/services/dictionary_service.py - Dictionary service → Word corpus: queries local words
app/services/dictionary_service.py - Dictionary service → Rule-based morphology: derives forms
app/services/dictionary_service.py - DictionaryAPI adapter → Provider HTTP transport: uses transport
- Datamuse adapter → Provider HTTP transport: uses transport
- Offline dictionary → Word corpus: uses local data
- DictionaryAPI adapter → DictionaryAPI.dev: requests definitions
README.md - Datamuse adapter → Datamuse API: requests word relations
README.md - Vocabulary lists → Python client: fetches missing entries
app/vocabulary.py