Skip to main content

Wrapper for Free Dictionary API https://dictionaryapi.dev/

Project description

PyPI PyPI - Status PyPI - Python Version PyPI - Downloads Read the Docs API`s working PyPI - License GitHub issues

python-freeDictionaryAPI is a wrapper for Free Dictionary API.

Library is simple, light and uses very cool fully free dictionary API.

Library components can be used with high level API (clients) or if you wish so you can use only some implemented parts that you`re interested in (like URL generating, parsers, …).

Implemented synchronous and asynchronous clients that powered with httpx and aiohttp accordingly.

If you do not prefer to use implemented clients and want to use some other web lib. So, it is synchronous and asynchronous base clients for inheriting. All you need it is to implement one method that makes HTTP response.

You can read the docs here.

Installation

$ pip install python-freeDictionaryAPI

Super Quick Start

>>> from freedictionaryapi.clients.sync_client import DictionaryApiClient
>>> with DictionaryApiClient() as client:
...     parser = client.fetch_parser('hello')
>>> word = parser.word
>>> word.word
'hello'
>>> word.phonetics
[Phonetic(text='/həˈloʊ/', audio='https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3'), Phonetic(text='/hɛˈloʊ/', audio='https://lex-audio.useremarkable.com/mp3/hello_us_2_rr.mp3')]
>>> for meaning in word.meanings:
...     print(meaning.part_of_speech)
...     for definition in meaning.definitions:
...             orint(definition)
...     print()
noun
Definition(definition='An utterance of “hello”; a greeting.', example='she was getting polite nods and hellos from people', synonyms=['greeting', 'welcome', 'salutation', 'saluting', 'hailing', 'address', 'hello', 'hallo'])

intransitive verb
Definition(definition='Say or shout “hello”; greet someone.', example='I pressed the phone button and helloed', synonyms=None)

exclamation
Definition(definition='Used as a greeting or to begin a phone conversation.', example='hello there, Katie!', synonyms=None)
>>> parser.get_transcription()
'/həˈloʊ/'
>>> parser.get_link_on_audio_with_pronunciation()
'https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3'
>>> parser.get_all_definitions()
['An utterance of “hello”; a greeting.', 'Say or shout “hello”; greet someone.', 'Used as a greeting or to begin a phone conversation.']
>>> parser.get_all_synonyms()
['hello', 'hailing', 'welcome', 'address', 'salutation', 'hallo', 'saluting', 'greeting']
>>> parser.get_all_examples()
['she was getting polite nods and hellos from people', 'I pressed the phone button and helloed', 'hello there, Katie!']

Developer

Good luck!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-freeDictionaryAPI-0.9.9.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

python_freeDictionaryAPI-0.9.9-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file python-freeDictionaryAPI-0.9.9.tar.gz.

File metadata

  • Download URL: python-freeDictionaryAPI-0.9.9.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for python-freeDictionaryAPI-0.9.9.tar.gz
Algorithm Hash digest
SHA256 3ef03af730535c0dc8ed8137224f6f6fc182f77f493b72a3157ef713c269712c
MD5 845270629bf646726f50a51c3d547b70
BLAKE2b-256 a233b9f702aaee10a1a741a17c20dd077067d21c8fed3c6bab47e5c1577a33cf

See more details on using hashes here.

File details

Details for the file python_freeDictionaryAPI-0.9.9-py3-none-any.whl.

File metadata

  • Download URL: python_freeDictionaryAPI-0.9.9-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for python_freeDictionaryAPI-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8427288dea4f43217c193593dbbf1375be1d0e2efb11ebf17b72d15b22e0f958
MD5 e176a1a026c536106fec4063344bf5a1
BLAKE2b-256 bd5ffb21b8af9afa6dabc084f4254e063043606ae0faeb0e6e3314f4f60d71d8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page