You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Flake8](https://flake8.pycqa.org/en/latest/), [Black](https://github.com/psf/black), and [mypy](https://mypy.readthedocs.io/en/stable/) to ensure consistant code formmating.
79
79
80
80
You can run linting on your code at any time with:
81
81
82
82
```sh
83
83
# Run isort
84
-
poetry run isort async_search_client tests
84
+
poetry run isort meilisearch_python_async tests
85
85
86
86
# Run black
87
-
poetry run black async_search_client tests
87
+
poetry run black meilisearch_python_async tests
88
88
89
89
# Run flake8
90
-
poetry run flake8 async_search_client tests
90
+
poetry run flake8 meilisearch_python_async tests
91
91
92
92
# Run mypy
93
-
poetry run mypy async_search_client
93
+
poetry run mypy meilisearch_python_async
94
94
```
95
95
96
96
It is also suggested that you setup [pre-commit](https://pre-commit.com/) in order to run linting when you commit changes to you branch. To setup pre-commit for this project run:
@@ -137,7 +137,7 @@ Type hints on files in the tests directory are optional.
137
137
138
138
This project uses [pytest](https://docs.pytest.org/en/stable/) and [tox](https://tox.readthedocs.io/en/latest/) for testing. Please ensure that any additions/changes you make to the code have tests to go along with them. Code coverage should not drop blow it's current level with any pull requests you make, if it does the pull request will not be accepted.
139
139
You can view the current coverage level in the codecov badge on the
140
-
[main github page](https://github.com/sanders41/async-search-client). You can run tests and see the
140
+
[main github page](https://github.com/sanders41/meilisearch-python-async). You can run tests and see the
141
141
code coverage by running.
142
142
143
143
Before running the tests start a Docker container running MeiliSearch.
@@ -162,7 +162,7 @@ poetry run pytest --cov-report term-missing
162
162
In additon to mainting the coverage percentage please ensure that all
163
163
tests are passing before submitting a pull request.
164
164
165
-
tox can be used to run both linting, and run the tests in all versions of Python async-search-client supports. Note that you will need to have all the verions of Python installed for this to work.
165
+
tox can be used to run both linting, and run the tests in all versions of Python meilisearch-python-async supports. Note that you will need to have all the verions of Python installed for this to work.
166
166
167
167
```sh
168
168
poetry run tox
@@ -208,11 +208,11 @@ git remote -v
208
208
209
209
## Making a Pull Request
210
210
211
-
After pushing your code to origin it is now on GitHub but not yet part of the async-search-client project. When you’re ready to ask for a code review, file a pull request. Before you do, once again make sure that you have followed all the guidelines outlined in this document regarding code style, tests, and documentation.
211
+
After pushing your code to origin it is now on GitHub but not yet part of the meilisearch-python-async project. When you’re ready to ask for a code review, file a pull request. Before you do, once again make sure that you have followed all the guidelines outlined in this document regarding code style, tests, and documentation.
212
212
213
213
### Make the pull request
214
214
215
-
If everything looks good, you are ready to make a pull request. This is how you let the maintainers of the async-search-client project know you have code ready to be reviewed. To submit the pull request:
215
+
If everything looks good, you are ready to make a pull request. This is how you let the maintainers of the meilisearch-python-async project know you have code ready to be reviewed. To submit the pull request:
216
216
217
217
1. Navigate to your repository on GitHub
218
218
2. Click on the Pull Request button for your feature branch
Async Search Client is a Python async client for the [MeiliSearch](https://github.com/meilisearch/MeiliSearch) API. MeiliSearch also has an official [Python client](https://github.com/meilisearch/meilisearch-python).
9
+
💡MeiliSearch Python Async was originally named [Async Search Client](https://github.com/sanders41/async-search-client)
10
+
and was renamed to make the purpose more clear. All of the functionality remains the same and development continues from where Async Search Client left off.
11
+
12
+
Meilisearch Python Async is a Python async client for the [MeiliSearch](https://github.com/meilisearch/MeiliSearch) API. MeiliSearch also has an official [Python client](https://github.com/meilisearch/meilisearch-python).
10
13
11
14
Which of the two clients to use comes down to your particular use case. The purpose for this async client is to allow for non-blocking calls when working in async frameworks such as [FastAPI](https://fastapi.tiangolo.com/), or if your own code base you are working in is async. If this does not match your use case then the official client will be a better choice.
12
15
@@ -41,16 +44,16 @@ For the most part this client mirrors the functionality of the official client a
41
44
42
45
In some instances it isnot possible to return the data as an object because the structure will be dependant on your particular dataset and can't
43
46
be known ahead of time. In these instances you can either work with the data in the dictionary that is returned, or because you will know the
44
-
structure you can generate your own Classes.
47
+
structure you can generate your own Pydantic models.
45
48
46
-
As an example, if you want to get a movie from the [small movies example](https://github.com/sanders41/async-search-client/blob/main/datasets/small_movies.json) you could put the results into an objectwith the following
49
+
As an example, if you want to get a movie from the [small movies example](https://github.com/sanders41/meilisearch-python-async/blob/main/datasets/small_movies.json) you could put the results into an objectwith the following
# Inheriting from CamelBase will allow your class to automatically convert
@@ -84,17 +87,16 @@ Movie(
84
87
)
85
88
```
86
89
87
-
By inheriting from CamelBase, or any of the other [provided models](https://github.com/sanders41/async-search-client/tree/main/async_search_client/models)
90
+
By inheriting from CamelBase, or any of the other [provided models](https://github.com/sanders41/meilisearch-python-async/tree/main/meilisearch_python_async/models)
88
91
you will be inheriting Pydantic models and therefore have access to the funcitonality Pydantic provides
89
-
such as [validators](https://pydantic-docs.helpmanual.io/usage/validators/) and [Fields](https://pydantic-docs.helpmanual.io/usage/model_config/#alias-precedence). Pydantic will also automatically deserialized the data into the correct data type
90
-
based on the type hint provided.
92
+
such as [validators](https://pydantic-docs.helpmanual.io/usage/validators/) and [Fields](https://pydantic-docs.helpmanual.io/usage/model_config/#alias-precedence). Pydantic will also automatically deserialized the data into the correct data type based on the type hint provided.
91
93
92
94
## Installation
93
95
94
96
Using a virtual environmnet is recommended for installing this package. Once the virtual environment is created and activated install the package with:
* Note: `client.index("books") creates an instance of an Index object but does not make a network call to send the data yet so it does not need to be awaited.
117
119
118
120
```py
119
-
fromasync_search_clientimport Client
121
+
frommeilisearch_python_asyncimport Client
120
122
121
123
asyncwith Client('http://127.0.0.1:7700', 'masterKey') as client:
122
124
index = client.index("books")
@@ -144,7 +146,7 @@ Splitting documents into batches can be useful with large dataset because it red
144
146
during indexing.
145
147
146
148
```py
147
-
fromasync_search_clientimport Client
149
+
frommeilisearch_python_asyncimport Client
148
150
149
151
asyncwith Client('http://127.0.0.1:7700', 'masterKey') as client:
0 commit comments