Skip to main content

A fully-featured and blazing-fast Python API client to interact with Algolia.

Project description

Algolia for Python

The perfect starting point to integrate Algolia within your Python project

PyPI Python versions License

DocumentationDjangoCommunity ForumStack OverflowReport a bugFAQSupport

✨ Features

  • Thin & minimal low-level HTTP client to interact with Algolia's API
  • Supports Python from 3.8

💡 Getting Started

First, install Algolia Python API Client via the pip package manager:

pip install --upgrade 'algoliasearch>=4.0,<5.0'

You can now import the Algolia API client in your project and play with it.

from algoliasearch.search.client import SearchClient

_client = SearchClient("YOUR_APP_ID", "YOUR_API_KEY")

# Add a new record to your Algolia index
response = await _client.save_object(
    index_name="<YOUR_INDEX_NAME>",
    body={
        "objectID": "id",
        "test": "val",
    },
)

# use the class directly
print(response)

# print the JSON response
print(response.to_json())

# Poll the task status to know when it has been indexed
await client.wait_for_task(index_name="<YOUR_INDEX_NAME>", task_id=response.task_id)

# Fetch search results, with typo tolerance
response = await _client.search(
    search_method_params={
        "requests": [
            {
                "indexName": "<YOUR_INDEX_NAME>",
                "query": "<YOUR_QUERY>",
                "hitsPerPage": 50,
            },
        ],
    },
)

# use the class directly
print(response)

# print the JSON response
print(response.to_json())

For full documentation, visit the Algolia Python API Client.

❓ Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client. You can also open a GitHub issue

Contributing

This repository hosts the code of the generated Algolia API client for Python, if you'd like to contribute, head over to the main repository. You can also find contributing guides on our documentation website.

📄 License

The Algolia Python API Client is an open-sourced software licensed under the MIT license.

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

algoliasearch-4.17.0.tar.gz (339.2 kB view details)

Uploaded Source

Built Distribution

algoliasearch-4.17.0-py3-none-any.whl (902.1 kB view details)

Uploaded Python 3

File details

Details for the file algoliasearch-4.17.0.tar.gz.

File metadata

  • Download URL: algoliasearch-4.17.0.tar.gz
  • Upload date:
  • Size: 339.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for algoliasearch-4.17.0.tar.gz
Algorithm Hash digest
SHA256 35c62bad63d65b0172acf41fc3c917164770a446daee480e64c5872de1d88ad8
MD5 5dc4d0ec251b203d1b09020703630e2a
BLAKE2b-256 df237475bdd8c41e8ab5790d6ee9c6bdcbda90debb2817a62b0c08476961793a

See more details on using hashes here.

Provenance

The following attestation bundles were made for algoliasearch-4.17.0.tar.gz:

Publisher: release.yml on algolia/algoliasearch-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file algoliasearch-4.17.0-py3-none-any.whl.

File metadata

File hashes

Hashes for algoliasearch-4.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f12f2b5f6d77ce8912b83411901358544941a540327ffbcc5900acbd4e5a6e60
MD5 761cb68178c5f4d861c332020927cdae
BLAKE2b-256 76a2599ba48580817e25abf83135ac3a95dcfb459b08a5d47bb34fddb571ef8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for algoliasearch-4.17.0-py3-none-any.whl:

Publisher: release.yml on algolia/algoliasearch-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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