|
1 | | -# Algolia Search API Client for Python |
| 1 | +<p align="center"> |
| 2 | + <a href="https://www.algolia.com"> |
| 3 | + <img alt="Algolia for Python" src="https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/readme-banner.png" > |
| 4 | + </a> |
2 | 5 |
|
3 | | -[Algolia Search](https://www.algolia.com) is a hosted search engine capable of delivering realtime results from the first keystroke. |
| 6 | + <h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your Python project</h4> |
4 | 7 |
|
5 | | -The **Algolia Search API Client for Python** lets |
6 | | -you easily use the [Algolia Search REST API](https://www.algolia.com/doc/rest-api/search) from |
7 | | -your Python code. |
| 8 | + <p align="center"> |
| 9 | + <a href="https://travis-ci.org/algolia/algoliasearch-client-python"><img src="https://img.shields.io/travis/algolia/algoliasearch-client-python/master.svg" alt="Build Status"></img></a> |
| 10 | + <a href="https://pypi.org/project/algoliasearch"><img src="https://img.shields.io/pypi/v/algoliasearch.svg" alt="PyPI"></img></a> |
| 11 | + <a href="https://pypi.org/project/algoliasearch"><img src="https://img.shields.io/pypi/pyversions/ansicolortags.svg" alt="Python versions"></img></a> |
| 12 | + <a href="https://pypi.org/project/algoliasearch"><img src="https://img.shields.io/pypi/l/ansicolortags.svg" alt="License"></a> |
| 13 | + </p> |
| 14 | +</p> |
8 | 15 |
|
9 | | -[](https://travis-ci.org/algolia/algoliasearch-client-python) [](http://badge.fury.io/py/algoliasearch) |
| 16 | +<p align="center"> |
| 17 | + <a href="https://www.algolia.com/doc/api-client/getting-started/install/python/" target="_blank">Documentation</a> • |
| 18 | + <a href="https://github.com/algolia/algoliasearch-django" target="_blank">Django</a> • |
| 19 | + <a href="https://discourse.algolia.com" target="_blank">Community Forum</a> • |
| 20 | + <a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> • |
| 21 | + <a href="https://github.com/algolia/algoliasearch-client-python/issues" target="_blank">Report a bug</a> • |
| 22 | + <a href="https://www.algolia.com/support" target="_blank">Support</a> |
| 23 | +</p> |
10 | 24 |
|
| 25 | +## ✨ Features |
11 | 26 |
|
12 | | -## API Documentation |
| 27 | +- Thin & minimal low-level HTTP client to interact with Algolia's API |
| 28 | +- Supports Python: `2.7`, `3.4`, `3.5`, `3.6`, and `3.7` |
| 29 | +- Contains blazing-fast asynchronous methods built on top of the [Asyncio](https://docs.python.org/3/library/asyncio.html) |
13 | 30 |
|
14 | | -You can find the full reference on [Algolia's website](https://www.algolia.com/doc/api-client/python/). |
| 31 | +## 💡 Getting Started |
15 | 32 |
|
16 | | -## Getting Help |
| 33 | +First, install Algolia Python API Client via the [pip](https://pip.pypa.io/en/stable/installing) package manager: |
| 34 | +```bash |
| 35 | +pip install --upgrade 'algoliasearch>=2.0,<3.0' |
| 36 | +``` |
17 | 37 |
|
18 | | -- **Need help**? Ask a question to the [Algolia Community](https://discourse.algolia.com/) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/algolia). |
19 | | -- **Found a bug?** You can open a [GitHub issue](https://github.com/algolia/algoliasearch-client-python/issues). |
| 38 | +Then, create objects on your index: |
| 39 | +```py |
| 40 | +from algoliasearch.search_client import SearchClient |
| 41 | + |
| 42 | +client = SearchClient.create('YourApplicationID', 'YourAPIKey') |
| 43 | +index = client.init_index('your_index_name') |
| 44 | + |
| 45 | +index.save_objects(['objectID': 1, 'name': 'Foo']) |
| 46 | +``` |
| 47 | + |
| 48 | +Finally, you may begin searching a object using the `search` method: |
| 49 | +```py |
| 50 | +objects = index.search('Fo') |
| 51 | +``` |
| 52 | + |
| 53 | +For full documentation, visit the **[Algolia Python API Client](https://www.algolia.com/doc/api-client/getting-started/install/python/)**. |
| 54 | + |
| 55 | +## 📄 License |
| 56 | + |
| 57 | +Algolia Python API Client is an open-sourced software licensed under the [MIT license](LICENSE.md). |
0 commit comments