• alifhughes over 2 years ago

    alifhughes edited about 1 year ago
    Hey everyone!
    I am pleased to announce that J0J0, Lambengolmo and myself have been working hard to set the basis for what we hope to be the main active fork of the "Official Python Discogs API Client". This was born out of the news that the official Python client maintained by Discogs has been deprecated, see here for more info: https://www.discogs.com/forum/thread/820127.

    Our repo is https://github.com/joalla/discogs_client - and the newly updated PyPI package is here: https://pypi.org/project/python3-discogs-client/

    We are committed to keeping the fork active and maintained. We really welcome new PRs, and would like to kindly ask users to resubmit old PRs that were not merged into the official one. As maintainers we will also be looking to make changes to the client to keep it up to date with the official API spec. These are some of the things we've worked on and released already:

    - Support adding releases to the user's collection folders.
    - The "Discogs ratelimit headers" are now accessible through the client, which enables developers to take care of limitting requests to the API accordingly and thus prevent "Too many requests errors".
    - Support "Discogs lists" (https://www.discogs.com/lists), either through direct access or through the user model.
    - Packaging for Debian-based Linux distributions (Ubuntu, Linux Mint, Ubuntu Studio, ...). Package name: python3-discogs-client and the link to package is: https://packages.debian.org/sid/python3-discogs-client

    Release notes:
    - https://github.com/joalla/discogs_client/releases/tag/v2.3.1
    - https://github.com/joalla/discogs_client/releases/tag/v2.3.2

    To install the client use:
    pip install python3-discogs-client

    Any questions are welcome either here or on the Github repo in the issues section: https://github.com/joalla/discogs_client/issues
    We will be around to answer them as quick as possible.

    Many thanks and hope to see some PRs soon!

    Joalla Python Discogs API Client Maintainers

    Lambengolmo
    , J0J0, alifhughes
  • J0J0 over 2 years ago

    Hi ADO16,
    I redirected your question here, so we have all the information in this thread.
    ADO16
    How compatible is the new python client? could it effectively run as a drop-in replacement? what changes are you planning to make?


    Yes, the “new” client is 100% compatible with the original one and can be run as a drop-in replacement.

    usage of the module did not change, eg you still import like this:

    import discogs_client

    as for changes, our first goals are to get the existing unmerged PR’s of the original repo reviewed and merged. best if original submitters resubmit to us but if not we would do it ourselves, in an order we think it is useful/essential.

    please have a look at discogs original client repo and look through unmerged prs. if you think something should be priorized, give us a note here and let’s discuss it 😀
  • mjb over 2 years ago

    Please consider adding a changelog.
  • J0J0 over 2 years ago

    hi mjb, please find the changelog following the posted git release links.
  • mjb over 2 years ago

  • J0J0 over 2 years ago

    It is official now: Our package was accepted into Debian unstable on Wednesday this week:

    https://packages.debian.org/sid/python3-discogs-client and it should be installable using:

    apt install python3-discogs-client

    This is the basis to bring the package into further Debian-based Linux-Distributions. Eg Ubuntu has it's next "Import Freeze Date" around end of August, which means it's very likely the package will be available in Ubuntu 20.10 stable (October 2020 release) and all other Distros that derive from it. That's great news! :-)
  • J0J0 over 2 years ago

    And some more great news: A colleague at work just yesterday told me that he found the following in Alpine Linux (it's a minimalistic OS mostly used to build docker containers from):

    - https://pkgs.alpinelinux.org/packages?name=*discogs*&branch=edge
    - https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/10552

    It seems like this merge-request brings in version 2.3.2 of the "Joalla Client" into the distribution.

    Thanks a lot to the maintainer of Alpine Linux package py3-discogs-client.
  • Ganjoe_Rood over 2 years ago

    alifhughes since your gh-repo is a fork, the issues feature isn't enabled by default.
  • J0J0 over 2 years ago

    Ganjoe_Rood
    alifhughes since your gh-repo is a fork, the issues feature isn't enabled by default.

    Hi, thanks a lot for the hint. I enabled it now.
    Jojo
  • bruce.diesel about 1 year ago

    Hi Jojo,

    I would be interested in contributing to this effort - initially as a tester / documenter as I am a programmer with many years experience but new to python, so this would be a great way for me to get involved in something that enables me to improve skills, contributes, and also satisfies my passion for music.

    Bruce
  • J0J0 about 1 year ago

    Hi bruce.diesel,
    thanks for reaching out! Sure, pull-requests to the documentation are very welcome. The documentation in README.mkd is lacking a lot of stuff that is possible with the module. If you'd like you could start there, get to know the module a little closer and write it down. Just send the pull as usual and we will review and merge. Thanks!
    If you have any other ideas on which end documentation could be improved, you are very welcome to propse them here :-)
    all the best
    Jojo
  • bruce.diesel about 1 year ago

    Perfect, I am writing python scripts to help me manage my music library, and keep it in sync with Discogs. I will document things as I go along.
  • Ganjoe_Rood about 1 year ago

    i wanna suggest that rather the docstrings should be worked on and to use Sphinx to generate most of the docs. if i may assist you i your efforts, just make yourself heard on GitHub, i'm watching that repo (but not this forum).
  • J0J0 about 1 year ago

    J0J0 edited about 1 year ago
    Hi Ganjoe_Rood, we would be glad if you'd assist with docstrings and Sphinx. I can't speak for the two other project members but fo me this would be new-territory anyway. I hope you get this message. I can't reach you on github directly. So for now, please send a pm here and let's discuss further steps or just submit a pull-request including your suggestions. Or just open an issue on github and let's talk there. Thanks!
  • faraz12inch45rpm about 1 year ago

    Cool! Will this now let us search beyond 10,000 records from a seller's inventory? Or is that something still enforced by discogs?
  • J0J0 about 1 year ago

    Hi faraz12inch45rpm,
    I was not aware of a limitation like this. Where exactely are you experiencing it? In you program that's using python3-discogs-client or in the search function on discogs.com?

    The limitations of the API itself (controlled by Discogs, obviously) are documented here: https://www.discogs.com/developers#page:home,header:home-rate-limiting

    Also the following chapter about pagination might be worth reading.
  • J0J0 about 1 year ago

    J0J0 edited about 1 year ago
    Recently python3-discogs-client v2.3.3 was released: https://github.com/joalla/discogs_client/releases/tag/v2.3.3

    The biggest change is that, as our repo name implies, we now removed Python2 support and continue focusing on supporting current Python3 versions (3.6 to 3.9)

    Thanks to contributors https://github.com/funkyfuture and https://github.com/JKatzwinkel for making this happen :-)

    As usual use your favorite package manager to install/update the package:

    pip install python3-discogs-client

    Keep those PR's coming and all the best from
    Joalla Discogs Client Team
  • faraz12inch45rpm about 1 year ago

    J0J0
    Hi faraz12inch45rpm,
    I was not aware of a limitation like this. Where exactely are you experiencing it? In you program that's using python3-discogs-client or in the search function on discogs.com?

    The limitations of the API itself (controlled by Discogs, obviously) are documented here: https://www.discogs.com/developers#page:home,header:home-rate-limiting

    Also the following chapter about pagination might be worth reading.


    Thanks, I was experiencing it with the previous python discogs client. I upgraded to your python3-discogs-client and now I get this error when searching a seller with 97,000 records in his inventory:

    Pagination above 50 is disabled for inventories other than your own
  • faraz12inch45rpm about 1 year ago

    Another minor thing is when upgrading to the python3 discogs client I had to change my print statements from:

    artist.encode('utf-8').strip()

    to:

    artist.encode('utf-8').strip().decode('utf8')

    Otherwise it prints the string with 'b' before each string, implying it is some byte thingy... Just a heads up.. I am open to any more elegant solution rather than what I use now ( artist.encode('utf-8').strip().decode('utf8') )
  • alifhughes about 1 year ago

    Hey faraz12inch45rpm, sorry you have to do that! Thanks for letting us know, I’ll look into it this weekend and see if there is anything I can do to fix it. I’ll report back here with any findings, thanks!
  • shodisc about 1 year ago

    Thanks for your effort!

    Is it possible to use this tool to list all songs from the particular artist based on his roles ("credits" section placed down left on the artist page)?

    For example:

    Criteria: Role "Production" -> list of all the songs where the artist is listed as a producer
    Criteria: Role "Featuring & Presenting" -> list of all the songs where the artist is listed as a feature
    etc. (the same for "Remix", "Vocals", etc)

    Thanks in advance!
  • alifhughes about 1 year ago

    faraz12inch45rpm
    Another minor thing is when upgrading to the python3 discogs client I had to change my print statements from:

    artist.encode('utf-8').strip()

    to:

    artist.encode('utf-8').strip().decode('utf8')

    Otherwise it prints the string with 'b' before each string, implying it is some byte thingy... Just a heads up.. I am open to any more elegant solution rather than what I use now ( artist.encode('utf-8').strip().decode('utf8') )


    Hey faraz12inch45rpm, sorry for slight delay but I've had a chance to catch up with this. So do you know why you need to encode it? As far as I can see I think the .encode('utf-8') is unnecessary and that is the the bit that is actually encoding it into byte code, which is why the b'...' is showing, which is why you need to add the subsequent .decode('utf-8') on the end. The string is already encoded in utf-8 so I don't believe you need to do it yourself, in your example, artist.strip() should suffice. See example below

    >>> s = 'Hello world'
    >>> s.encode('utf-8')
    b'Hello world'
    >>> s.encode('utf-8').decode('utf-8')
    'Hello world'
    >>> s
    'Hello world'


    If you have anymore questions, let me know! If you think I've missed something, raise an issue here: https://github.com/joalla/discogs_client/issues and I'll get too it. I took references from here: https://stackoverflow.com/questions/6224052/what-is-the-difference-between-a-string-and-a-byte-string
  • alifhughes about 1 year ago

    Hey shodisc I'll try this out and get back to you
  • J0J0 about 1 year ago

    J0J0 edited about 1 year ago
    J0J0
    ...
    The limitations of the API itself (controlled by Discogs, obviously) are documented here: https://www.discogs.com/developers#page:home,header:home-rate-limiting

    Also the following chapter about pagination might be worth reading.


    faraz12inch45rpm
    Thanks, I was experiencing it with the previous python discogs client. I upgraded to your python3-discogs-client and now I get this error when searching a seller with 97,000 records in his inventory:

    Pagination above 50 is disabled for inventories other than your own

    Hi again faraz12inch45rpm,
    which version of discogs_client where you exactly using back then (and what was the error with that version) and which version are you using now? I'd like to do some research in git history to find out if something's changed in these parts of the code.

    The message "Pagination above 50 is disabled for inventories other than your own" is definitely not produced by discogs_client, it is the response of the API itself.

    Also a snippet of your code would be helpful, perhaps somebody could think of a workaround to achieve your goal with searching within huge sellers inventories. Thanks! :-)
  • J0J0 about 1 year ago

    J0J0 edited about 1 year ago
    BTW there were two maintenance releases recently and the latest available version of python3-discogs-client currently is: https://github.com/joalla/discogs_client/releases/tag/v2.3.5

    As usual it's also available on PyPi:

    pip install python3-discogs-client

    Furthermore this version was packaged for Debian/GNU Linux:

    apt install python3-discogs-client

    https://packages.debian.org/bullseye/python3-discogs-client
    https://packages.debian.org/sid/python3-discogs-client

    and Alpine Linux:

    https://pkgs.alpinelinux.org/packages?name=*discogs*&branch=edge
  • DexVinyl about 1 year ago

    DexVinyl edited about 1 year ago
    Hey folks, sorry if this is a crazy obvious question, but I can't find the Catalague Number, or Date Added To Discogs endpoints in the releases result, can anyone point me at them?

    also having problems accessing the image URL in releases.images

    (sorry I'm new to python, but i think i have all the other endpoints i need sorted out)
  • J0J0 about 1 year ago

    J0J0 edited about 1 year ago
    No it's actually not crazy obvious. The catalog number is surprisingly hard to find. Give me a minute.... I think I described this in some post on this forum already. Need to search for it.......

    In this post I generally describe how to "search" for things in the api client using the dir function. The path to the cat no is described explicitely in one of my examples: https://www.discogs.com/forum/thread/820098#8141812

    I hope that helps :-)
    All the best and feel free to report your progress here so others (including me) can learn from it.
    Jojo
  • DexVinyl about 1 year ago

    DexVinyl edited about 1 year ago
    That helps for Catalogue Number, but i've tried the Data block for Releases and still can't find the Date it was added to collection.

    Thanks in advance

    J0J0
    No it's actually not crazy obvious. The catalog number is surprisingly hard to find. Give me a minute.... I think I described this in some post on this forum already. Need to search for it.......

    In this post I generally describe how to "search" for things in the api client using the dir function. The path to the cat no is described explicitely in one of my examples: https://www.discogs.com/forum/thread/820098#8141812

    I hope that helps :-)
    All the best and feel free to report your progress here so others (including me) can learn from it.
    Jojo
  • DexVinyl about 1 year ago

    also, i keep hitting the 429, API rate limit when I'm pulling specifically box sets of Various Artists, is there a way to access the header information for API calls remaining, so i can build in some wait time (sleep)
  • alifhughes about 1 year ago

    Hey Dex, yes you should be able to access that information, the change was made here: https://github.com/joalla/discogs_client/pull/1
    DexVinyl
    also, i keep hitting the 429, API rate limit when I'm pulling specifically box sets of Various Artists, is there a way to access the header information for API calls remaining, so i can build in some wait time (sleep)
  • DexVinyl about 1 year ago

    Hey folks, I'm having a somewhat strange issue, I'm coming up against a 404 error when hitting Unknown Artist I had the same issue with Various which i got past with if release.artists[0].id is 194 but using the same statement if release.artists[0].id is 355 does absolutely nothing neither does if release.artists[0].id is 194 or if release.artists[0].id is 355 with the last, 194 is processed according to the if

    any help please?
  • J0J0 about 1 year ago

    DexVinyl
    That helps for Catalogue Number, but i've tried the Data block for Releases and still can't find the Date it was added to collection.
    Jojo


    Interesting I don't know by heart and am surprised that it's so hard to find. Proably I will need this once too. Did you try the dir() function on everything as suggested? Or did you already find it by now?
  • J0J0 about 1 year ago

    DexVinyl


    also, i keep hitting the 429, API rate limit when I'm pulling specifically box sets of Various Artists, is there a way to access the header information for API calls remaining, so i can build in some wait time (sleep)


    This is a quick & dirty solution to use the exposed headers alifhughes just mentioned and handle the rate limits. It's not good but maybe it's good enough for your needs. Have look: https://github.com/JOJ0/discodos/blob/2c0fbd32b92d306c5b97a32b843cf052e4f7ac19/discodos/models.py#L979
  • J0J0 about 1 year ago

    J0J0 edited about 1 year ago
    DexVinyl
    Hey folks, I'm having a somewhat strange issue, I'm coming up against a 404 error when hitting Unknown Artist I had the same issue with Various which i got past with if release.artists[0].id is 194 but using the same statement if release.artists[0].id is 355 does absolutely nothing neither does if release.artists[0].id is 194 or if release.artists[0].id is 355 with the last, 194 is processed according to the if

    any help please?


    maybe those artists are somewhat special and don't return the same as regular artists do from discogs.com api itself. I would like to see if I get those same errors when I use it in DiscoDOS. Thing is I use a more release based approach there. You have some release id's for me that use eg. the Various artist (sorry too lazy to search for myself now).

    Also some example code of yours would help. I know posting code here is tedious, we just enabled discussions on our github repo. please post some snippets in the "Support" section: https://github.com/joalla/discogs_client/discussions/categories/support

    And if it's really an issue with the python module itself we can easily create an issue from there.

    thanks!
  • iordanougiannis about 1 year ago

    Hey everyone,

    I have started using the python client following this:

    https://github.com/joalla/discogs_client/blob/master/docs/authentication.md,

    but when I get to:

    >> d.get_access_token('verifier-here')

    it shows me the following error message:

    ValueError: Only unicode objects are escapable. Got b'dElxeTmeEJWFcXTHHSxeFTVOeYtH' of type <class 'bytes'>.

    The b'dElxeTmeEJWFcXTHHSxeFTVOeYtH' is the value of the request token.

    How can I fix it ? Thanks.
  • J0J0 about 1 year ago

    hi iordanougiannis,
    I guess it was you who fixed this issue himself already, right? :-)))

    https://github.com/joalla/discogs_client/pull/23

    Thanks again!
  • J0J0 about 1 year ago

    DexVinyl did you fix your issues or do you need further assistance? As mentioned already, best you file them on the discussion board: https://github.com/joalla/discogs_client/discussions
    HTH Jojo
  • MrJuusto about 1 year ago

    J0J0
    hi iordanougiannis,
    I guess it was you who fixed this issue himself already, right? :-)))

    https://github.com/joalla/discogs_client/pull/23

    Thanks again!

    That was actually me, haha.
  • iordanougiannis about 1 year ago

    Hey, thanks for the fix.

    I was trying to get all the releases of a specific artist and the results I got seem to include not just the releases but the appearances too and maybe other things.

    Is there a way to get just the releases ? Thanks.
  • alifhughes about 1 year ago

    iordanougiannis
    Hey, thanks for the fix.

    I was trying to get all the releases of a specific artist and the results I got seem to include not just the releases but the appearances too and maybe other things.

    Is there a way to get just the releases ? Thanks.


    Hey iordanougiannis, if you could open an issue on github here: https://github.com/joalla/discogs_client/issues/ with some examples that would be great. We'll then take a look at it and see if it is a problem or something we can implement. Thanks!
  • esocid about 1 year ago

    hey, sorry if this is the wrong place to ask, but how do i get the catno of a release? thanks.
  • alifhughes about 1 year ago

    Hey esocid, would you mind opening a support request here? https://github.com/joalla/discogs_client/discussions We're trying to centralise knowledge about these types of questions to help people in the future too, hope that is okay!
  • J0J0 6 months ago

    J0J0 edited 6 months ago
    We've just released python3-discogs-client v2.3.13, have a look at the release notes: https://github.com/joalla/discogs_client/releases/tag/v2.3.13

    Also, since we didn't post updates in this thread for quite some time now, some things to be highlighted:

    - Previous release notes: https://github.com/joalla/discogs_client/releases
    - Great progress on our documentation hosted at https://python3-discogs-client.readthedocs.io/en/latest/
    - https://github.com/joalla/discogs_client/discussions is showing quite some liveliness in the project, which we are very happy about
    - Great tools are using the library, some to mention are the mp3 tagging tools https://beets.io and https://docs.puddletag.net/

    Thanks to all our library users, code submitters, documentation writers and everybody else contributing in any way to the project!
  • roggrogg 6 months ago

    Thanx a lot!
  • J0J0 5 months ago

    Yesterday python3-discogs-client v2.3.14 was released, featuring some additions to handling collection folders: https://github.com/joalla/discogs_client/releases/tag/v2.3.14
  • J0J0 2 months ago

    We just released python3-discogs-client 2.3.15, again with a handy new feature around collection handling. Also the documentation around the collection handling received a nice overhaul.

    Release Notes: https://github.com/joalla/discogs_client/releases/tag/v2.3.15
    Docs: https://python3-discogs-client.readthedocs.io/en/latest/

Log In You must be logged in to post.