GregEremeev / gosuslugi-api

Toolset to work with dom.gosuslugi.ru API
Other
11 stars 2 forks source link

Limited information when calling get_actual_houses and get_organization #2

Closed DianaTolstyga closed 3 years ago

DianaTolstyga commented 3 years ago

Methods get_actial_houses and get_organization work well but do not show all the detailed information which gosuslugi portal provides. I.e. the portal gives many details on a specified house incl its address, type of house, cadastre number, construction year, size of building, condition etc. While get_actual_houses method gives only data on house condition. The same story with get_organization method. Could you please advise how to get all relevant information? Thanks portal data on a specified house

[data received through get_actual_houses method]

Screenshot 2021-05-03 at 12 04 46
GregEremeev commented 3 years ago

Hello @DianaTolstyga

Methods get_actial_houses and get_organization work well but do not show all the detailed information which gosuslugi portal provides.

I think you meant get_actial_houses and get_organizationS. They are not supposed to show all information cause they take data from collections endpoints. If you need to obtain more information on a particular object then you need to use methods that take data from endpoints with detailed data.

portal data on a specified house

If you want to obtain data from this page then you need to use get_home_management method

client.get_home_management('a5893115-8e9d-4b4c-9fd6-9aa07fd59053')

BTW, don't use pictures to show data, just post raw json.

GregEremeev commented 3 years ago

Well, I guess, I can write README with examples of every method. If you are going to use this library.

DianaTolstyga commented 3 years ago

Hi @GregEremeev , Thank you very much for your prompt response and very useful tips.
Absolutely, readme with examples would be very useful! I found it a bit challenging to put the right arguments for the methods (i.e. which guid should I use as an org_guid argument for get_home_managements method since organization's guid does not work: client.get_home_managements(‘4105ee91-9191-4840-b788-f3d4db7c5f1b’))

DianaTolstyga commented 3 years ago

@GregEremeev Could you please advise if there is a chance to get the list of houses managed by certain organization?

In my task I have a list of 1000 INNs and I have to get detailed house data (provided by get_home_management method) for all houses managed by the organization with a specified inn.

GregEremeev commented 3 years ago

I found it a bit challenging to put the right arguments for the methods

Yes, without knowing the API it's not simple.

Could you please advise if there is a chance to get the list of houses managed by certain organization?

Yes, it's possible. All organizations are obliged to send actual information about houses, which they manage, to ГИС ЖКХ. You need to use get_licenses method to obtain xlsx files with this information(look at the README). If you know a region and inn of your organization, It will be enough to find *every house, which is managed by the organization.

GregEremeev commented 3 years ago

@DianaTolstyga I released 0.6.0 version, you can use it.

DianaTolstyga commented 3 years ago

Thank you for the support @GregEremeev! README and the updated version are very much appreciated!

Although my code taken from README couldn't pick up the new 0.6.0 version and its get_licenses method, need some time to figure out why.. But could you please confirm that get_licenses would be able to give house data: either the detailed list of house data (incl. cadastre number, total square, building year etc.) or at least home_management_guid (with which I could get all the details through get_home_management method)? Thank you @GregEremeev

GregEremeev commented 3 years ago

Thank you for the support @GregEremeev! README and the updated version are very much appreciated!

Don't forget to add a star to this library.

Although my code taken from README couldn't pick up the new 0.6.0 version and its get_licenses method, need some time to figure out why..

That's because you are not aware of how to manage Python's dependencies via pip Read this and always use python environment to work with Python.

But could you please confirm that get_licenses would be able to give house data:

get_licenses is a start. It gives you a list of houses for some specific regions. From this list, you can get mapping organization - building. You can get all the necessary ids from this list to get detailed information for a specific building or management company or organization via other methods.

You just need to install the correct version of this library and play with examples from README.

DianaTolstyga commented 3 years ago

Thank you, @GregEremeev, examples from README are workable!

GregEremeev commented 3 years ago

@DianaTolstyga you are welcome.

I'll mark this issue as solved. If you have any other questions you can create another one.