lcosmin / boardgamegeek

A Python interface to boardgamegeek.com. Pulls information from BGG and creates Python objects for the data.
BSD 3-Clause "New" or "Revised" License
116 stars 71 forks source link

Is it possible to access the private information? #61

Open Flope opened 4 years ago

Flope commented 4 years ago

Hi, I was wondering if it is possible to access the private information of the collections. I understand that we need to be login but I am not sure how to do it from your API.

Thanks

outis commented 2 years ago

The API currently doesn't support log-ins. I've got a solution for this, though I have a few testing related questions for @lcosmin (or any other responsible devs):

  1. I'd like to add some tests for add_collection_items_from_xml (in loaders/collection.py), as that function must be updated to support private info. Is there a preference for putting it in a new test file or an existing file?
    1. Where & how are the files in test/xml/ used?
  2. Should test/_bgg.py be used for anything? It seems to be a slightly different version of test/test_utils.py.
outis commented 2 years ago

I think I see the answer for 1.i.: the xml files are loaded by simulate_bgg and simulate_legacy_bgg (in test/_common.py), which simulate BGG.com's response to a request by setting one as a mocked side effect for "requests.sessions.Session.get". To determine which file to load, the simulator functions first sort the parameters by key and join them as a query string. Thus, to create & use a sample XML file, the file must include all parameters used in the query in order of the keys.