Skip to main content

A simple lightweight python wrapper for the Microsoft Cognitive Services.

Project description

# py-ms-cognitive
Thin wrapper for the Microsoft Cognitive Services

A continuation of: https://github.com/tristantao/py-bing-search


Intro
=====
Extremely thin python wrapper for Microsoft Cognitive Services API. Please note that this module does not use the older Microsoft Azure DataMarket WebSearch API (deprecated Dec 15 2016). This module requires that you sign up for Microsoft Cognitive Services and acquire application key for the corresponding services.

The modules uses OAuth, so you'll need to get your key here (free for up to 1K/Mon):
* [Subscribe for Free](https://www.microsoft.com/cognitive-services/en-us/sign-up)


Installation
=====
#####for python 2.7.*

```sh
pip install py-ms-cognitive
```

#####for python 3.*

```sh
pip3 install py-ms-cognitive
```

*Requires the requests library.

Usage
=====

Remember to set the `API_KEY` as your own.

####For Web Results:

```py
>>> from py_ms_cognitive import PyMsCognitiveWebSearch
>>> search_term = "Python Software Foundation"
>>> search_service = PyMsCognitiveWebSearch(('Your-Api-Key-Here', search_term)
>>> first_fifty_result= search_service.search(limit=50, format='json') #1-50
>>> second_fifty_result= search_service.search(limit=50, format='json') #51-100

>>> print (second_fifty_result[0].snippet)
u'Python Software Foundation Home Page. The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to ...'
```

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

py-ms-cognitive-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_ms_cognitive-0.1.0-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file py-ms-cognitive-0.1.0.tar.gz.

File metadata

File hashes

Hashes for py-ms-cognitive-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5095cab9c2a84cb8619298ad8a90d5f4f57720d167b17d4d4e334fff95e31a3
MD5 38a6521be9d4e3ae0459efe185015b53
BLAKE2b-256 ad43e265001886b45f0c3e4150f322f6ae292a3667da068c3d32eea4810ca139

See more details on using hashes here.

File details

Details for the file py_ms_cognitive-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for py_ms_cognitive-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9406650971bc30b1a665f740931fd00129aea153b48e41a8399e8fc0fbdd2bf8
MD5 57d00bc69da88651cd96c845848ad7d2
BLAKE2b-256 fd1ab19954c00b0eea5b08b11fe5371889c59fa4cdc63ee3e8fb5b74f8e1b5f5

See more details on using hashes here.

Supported by

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