A api wrapper for the bing apis.
Project description
AsyncBing
asyncbing is an asyncio api wrapper for the Bing Search Api. It uses a modern async
/await
python api.
Docs
Installing
python -m pip install asyncbing
For the stable version of asyncbing.
python -m pip install git+https://github.com/TennisBowling/asyncbing/
For the unstable/cutting edge of asyncbing. Not recommended in production. \
Usage
Import it with
from asyncbing import search
Then initialize asyncbing with your Bing Search Api key guide like
s = search.Search('APIKEYGOESHERE')
Sample usage
Searching
import asyncbing
import asyncio
async def main():
async with asyncbing.Search('key') as s:
resp = await s.fetch('cool search term')
print(resp.matches)
oneresult = resp.getOne()
print(oneresult.name)
print(oneresult.url)
print(oneresult.snippet)
asyncio.run(main())
Translating
import asyncbing
import asyncio
async def main():
async with asyncbing.Translate('key', region='useast') as t:
resp = await t.translate('je veux traduire')
print(resp.detected_language)
print(resp.translated_output)
print(resp.translated_language)
asyncio.run(main())
(Normally, searching isn't part of the Bing Api's. It's part of the Microsoft Cognitive Api's. Might as well rename this to asyncms, or asyncmsapi, no?)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for asyncbing-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cec16be2b9aae3bbb8daa78a42d278a2dbc9067067d60ced6a8e397b828726af |
|
MD5 | 2da5d413d3e809355fbf33d0c15f5a57 |
|
BLAKE2b-256 | 85de4ba22dc0f0f2e4c23263880895f59635aec62726d3bd42f9f40ae4c3bf6d |