Create Class for every ressources
See original GitHub issueDescription
Currently, the python SDK contains only a few classes including Index
and Client
.
it would be nice to implement all the resources returned by the API of Meilisearch
in class that would have the effect to return more precise types.
Basic example Every resource could be defined as a class like:
class DocumentsInfo():
results: List[Dict[str, Any]]
offset: int
limit: int
total: int
def get_documents(self, parameters: Optional[Dict[str, Any]] = None) -> DocumentsInfo:
See this repository as a perfect example.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
An elegant way to implement shared classes that load heavy ...
An elegant way to implement shared classes that load heavy resources (in Java) ; public class ; ParserWrapper · private ; static final ......
Read more >Writing a custom DSC resource with PowerShell classes
This article shows how to create a simple resource that manages a file in a specified path.
Read more >Create custom resource classes - Sitefinity CMS Development
Create a new resource class and register it in Sitefinity. Resource classes distribute labels among ... Every resource is using the ResourceEntry attribute....
Read more >Chapter 3 Creating a RESTful Resource Class
Resource methods are methods of a resource class annotated with a request method designator. This section describes how to use Jersey to annotate...
Read more >Creating your own resource class - alt:V Documentation
To create our own resource class, we need to extend from the alt::IResource::Impl interface, and implement its methods. ... Remember that resources can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#513 Introduces this to the project so there are still changes to be made to ensure other resources also return class models
Just a note if you go this direction. Make sure to install camel-converter with the Pydantic extra
pipenv install camel-converter[pydantic]