Back

is the python package missing a type for Documents?

  • 0
  • Self Hosted
ZachHandley
7 Jul, 2023, 05:58

I do have an issue with a function over in another thread

TL;DR
The user is questioning the absence of a type for Documents in the Python package. They discuss the SDK generator and its functionality in creating definitions for different SDKs. It is mentioned that the issue can be taken to GitHub. No solution is provided in the thread.
ZachHandley
7 Jul, 2023, 05:58

trying to install llama_index in the appwrite docker lol

Drake
7 Jul, 2023, 05:59

In the python SDK, the various api methods return dictionaries...it might be possible to create some sort of typing for each model. We welcome PRs for this

ZachHandley
7 Jul, 2023, 06:00

can you link me to the one I need to contribute to? Is it the sdk-generator?

Drake
7 Jul, 2023, 06:02

https://github.com/appwrite/sdk-generator/tree/feat-python-type-hints

If you'd like to help, please comment in https://github.com/appwrite/sdk-for-python/issues/43 so that you can be assigned on the issue

ZachHandley
7 Jul, 2023, 06:21

well I did it for those functions but where are the SDK functions?

ZachHandley
7 Jul, 2023, 06:22

ah I see

ZachHandley
7 Jul, 2023, 06:22

I understand okay

ZachHandley
7 Jul, 2023, 06:22

I'll need to add the types themselves to the actual SDK itself

ZachHandley
7 Jul, 2023, 06:23

well the templates

ZachHandley
7 Jul, 2023, 08:19

Are they pulled from the API documentation or how does that work?

Drake
7 Jul, 2023, 14:09

Yes

ZachHandley
7 Jul, 2023, 20:10

Are you able to explain it a bit better? All I really need to understand is where/when it pulls the data? I think it's in the SDK right?

ZachHandley
7 Jul, 2023, 20:11

cause all I need is the actual types for Python, but I might have to edit the docs to match?

Drake
7 Jul, 2023, 20:14

Sorry I don't understand

ZachHandley
7 Jul, 2023, 20:16

I went through and typed all the types

ZachHandley
7 Jul, 2023, 20:16

but the issue I'm having is I want to return a Document type from the databases for instance, which means the API documentation needs to be changed to return a Python type if it's built from there, correct?

Drake
7 Jul, 2023, 20:17

You mean the API specs? Those don't need changing. The same specs can generate types for other languages

ZachHandley
7 Jul, 2023, 20:23

oh you're right, lemme look into it more, I'll take over the issue, I'll reply in the GitHub

ZachHandley
20 Jul, 2023, 19:04

okay so basically what it does is it pulls from the API using the SDK generator, parses the JSON data into classes and such, but where does it create the definitions for the Document type and stuff for the SDK's? When I look at them I only see the basics (client, id, etc.)

Drake
20 Jul, 2023, 19:22

but where does it create the definitions for the Document type and stuff for the SDK's

You mean where in the API specs?

ZachHandley
20 Jul, 2023, 19:32

Yeah that's what I assumed that is, the only difference between the PHP SDK/JS/Python is that Python's file in the SDK.php had a different getParam method from what I can tell

Drake
20 Jul, 2023, 19:53

it all comes from the schema definitions from the API specs

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more