deivit24 / python-steam-api

MIT License
25 stars 11 forks source link

steam.apps.get_app_details() returns string instead of dict #5

Closed Aliefe02 closed 11 months ago

Aliefe02 commented 1 year ago

steam.apps.get_app_details() function was supposed to return a dict value but it returns a string. Format of the string is for dict (for example there are "{ }" and "path: ") however there are some problems. True and False values are written as true and false. No capital T and F. I think this causes function to return values as string instead of dict. when i copy the returned value and correct true and false values to True and False and give this data to a variable python recognizes it as a dictionary. Pls fix this issue i really need this API (It's great btw)

PsiPi-Codes commented 11 months ago

So I believe this issue occurs because of the way it obtains the information. Python Steam API obtains the app details using json.request(), it then processes this information using json.load(). However json doesn't use True or False for boolean values, it uses true or false (no capitalization), that may be what is causing the error. I'll reply to this when I figure out a fix to this if you would like that.

PsiPi-Codes commented 11 months ago

Hello.

So I found the problem, the get_app_details() method returns json.dumps(json_loaded_response). The Issue isn't the way json and python write boolean values, it is this return function. json.dumps() returns a string, so even though it originally is a dictionary, it returns a string version of that dictionary. Removing json.dumps() from the return for the method fixes the issue. image This is the method image Remove json.dumps() and leave json_loaded_response, like this: image Then save the file, it should return a dictionary now.

If you have trouble finding the method, please feel free to contact me, but that solved it for me ^^

Aliefe02 commented 11 months ago

Thanks a lot

deivit24 commented 11 months ago

Thank you! If you want to create a PR and push, you can! Don't mind if people want to contribute. If not no worries! I will do it when I get home and update the package

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Ali EFE @.> Sent: Wednesday, July 26, 2023 7:26:17 PM To: deivit24/python-steam-api @.> Cc: Subscribed @.***> Subject: Re: [deivit24/python-steam-api] steam.apps.get_app_details() returns string instead of dict (Issue #5)

Closed #5https://github.com/deivit24/python-steam-api/issues/5 as completed.

— Reply to this email directly, view it on GitHubhttps://github.com/deivit24/python-steam-api/issues/5#event-9929709385, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AISPR3HING3GU7AMJSLBJA3XSGRRTANCNFSM6AAAAAAYASSHHY. You are receiving this because you are subscribed to this thread.Message ID: @.***>

PsiPi-Codes commented 11 months ago

I'm rather new to github (just made my account right now to resolve this issue) so I'll try to do the pull request, however if I can't finish it by today then that would be great, thank you for providing me and everyone else with this API, it has helped a lot with my own project.

deivit24 commented 11 months ago

No worries! Thanks that means alot!

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: PsiPi-Codes @.> Sent: Wednesday, July 26, 2023 7:33:53 PM To: deivit24/python-steam-api @.> Cc: David Salazar @.>; Comment @.> Subject: Re: [deivit24/python-steam-api] steam.apps.get_app_details() returns string instead of dict (Issue #5)

I'm rather new to github (just made my account right now to resolve this issue) so I'll try to do the pull request, however if I can't finish it by today then that would be great, thank you for providing me and everyone else with this API, it has helped a lot with my own project.

— Reply to this email directly, view it on GitHubhttps://github.com/deivit24/python-steam-api/issues/5#issuecomment-1652683488, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AISPR3CYMAM437BX3FYROIDXSGSODANCNFSM6AAAAAAYASSHHY. You are receiving this because you commented.Message ID: @.***>

PsiPi-Codes commented 11 months ago

I believe I have sent the pull request, please tell me if it worked (this is my first time).

deivit24 commented 11 months ago

Will let you know when I get home (tomorrow)!

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: PsiPi-Codes @.> Sent: Wednesday, July 26, 2023 7:51:08 PM To: deivit24/python-steam-api @.> Cc: David Salazar @.>; Comment @.> Subject: Re: [deivit24/python-steam-api] steam.apps.get_app_details() returns string instead of dict (Issue #5)

I believe I have sent the pull request, please tell me if it worked (this is my first time).

— Reply to this email directly, view it on GitHubhttps://github.com/deivit24/python-steam-api/issues/5#issuecomment-1652695408, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AISPR3DGRM6DLPAVOBOF4GTXSGUOZANCNFSM6AAAAAAYASSHHY. You are receiving this because you commented.Message ID: @.***>

PsiPi-Codes commented 11 months ago

Got it! Thank you.