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
118 stars 71 forks source link

Include syntactic sugar type methods. #25

Open commadelimited opened 8 years ago

commadelimited commented 8 years ago

Thanks for your time on this library. It's very well written. I'm using it locally to format plays for blog posts that I write weekly

Here: http://www.meeplemountain.com/articles/game-every-day-journal-june-16th-2016/ and here: http://www.meeplemountain.com/articles/2016/01/game-every-day/

I also wrote a quick script to compare the collections of two users: https://gist.github.com/commadelimited/c2b76b16252017aa1a519fb82c8c2d5b

I'm wondering if you've ever considered including methods like this in a syntactic sugar type module. One which doesn't tie directly to endpoints in the BGG API, but instead includes additional things that users might want.

commadelimited commented 8 years ago

If you're interested in that approach I'd be happy to work on this one and submit a PR.

lcosmin commented 8 years ago

Thanks for the appreciation! :)

I must admit I didn't consider adding the kind of extra functionality you're mentioning, but mostly because the focus was to expose as much of the BGG API as possible (and that was never 100% done), so it didn't cross my mind.

I'm going to leave the issue open for now, since it's valuable user feedback (I don't have much clue how people use this library).

About the PR, we'll have to wait until I finish refactoring the library, because it's not going to be 100% compatible with the current version.

commadelimited commented 8 years ago

Sure thing. I can see the potential for a number of methods that do this sort of thing. All built around existing classes and methods within your library, but not directly a one to one correlation between an endpoint.

commadelimited commented 8 years ago

Another useful property to return would be the URL to a game. This could be a dynamic property like so:

def game_url(self):
   return "https://www.boardgamegeek.com/boardgame/{id}/".format(id=self.id)

I have need of this one right now in fact so I'm going to use pretty much that same code.