sbliven / rcsbsearch

Python interface for the RCSB search API.
https://rcsbsearch.readthedocs.io
BSD 3-Clause "New" or "Revised" License
20 stars 7 forks source link

HTTPError: 400 Client Error: #4

Open pwrose opened 2 years ago

pwrose commented 2 years ago

The RCSB webservice url may have been changed. The Jupyter Notebooks now error out with: HTTPError: 400 Client Error: ...

ajc3527 commented 2 years ago

+1 same problem

tahereT commented 2 years ago

same problem

ncoish commented 2 years ago

For any who come to this issue looking for a solution, there are two PRs available which address this if you need a solution right away before they are merged and released to pypi:

I have not tested this one, but it is likely broken now because it used an old (discontinued) version of the search API. https://github.com/sbliven/rcsbsearch/pull/5

This PR makes a similar change, but also updates to the current version of the search API. It passes the current test suite, but hasn't yet been rigorously tested against the full API: https://github.com/sbliven/rcsbsearch/pull/6

joelb123 commented 2 years ago

The switchover to v2 service only has broken all downstream code using this package until a new version is pushed to PYPI. I find that PR #6 works for me, thanks @ncoish! However, broken versioning makes it impossible a branch directly with pip. I have forked the search-v2 branch and fixed the versioning, which is usable with pip at joelb123/rcsbsearch. I'll keep this repo alive until a new version appears in PyPI.

glaudys commented 1 year ago

The switchover to v2 service only has broken all downstream code using this package until a new version is pushed to PYPI. I find that PR #6 works for me, thanks @ncoish! However, broken versioning makes it impossible a branch directly with pip. I have forked the search-v2 branch and fixed the versioning, which is usable with pip at joelb123/rcsbsearch. I'll keep this repo alive until a new version appears in PyPI.

"joelb123/rcsbsearch" its available? I can't find

joelb123 commented 1 year ago

Hi, i put the fork with fixes at hydrationdynamics/rcsbsearch. However, be prepared that if you use this directly, you won't be able to distribute your dependent code on PYPI because of (very sensible) security restrictions on overrides. My solution to this for the moment was to include a full copy of the patched code in my sources, which is wholly unsatisfactory.

You can see a working example (with continuous-integration tests but not in a state I consider ready for others to use) in the query component of my zeiden code. The example uses the gql package to do the query. A sharp edge with rcsbsearch that I cut myself on at first is that sometimes query terms need the full prefixes while for some query terms using the full prefixes causes the term to not be recognized.

An alternative to using rcsbsearch is to screen-scrape RCSB GraphQL searches out of their search page and plunk that into a gql query. That works fine if your search isn't going to need to be flexible.

rcsbsearch can be used for accessing the Data API as well as the Search API, but the performance is worse than simply grabbing the full headers in JSON from the file interface. No matter which delivery method you use, it's trickier than it should be to convert the data to tabular form because there's no schema to distinguish which fields are optional lists as opposed to requisite lists.

Let me point out how unsatisfactory it is that RCSB doesn't provide a supported search client in python with working examples. sbliven/rcsbsearch has been removed from the Search API docs with nothing to replace it. Apparently so few of us are searching programmatically that nobody is complaining.

piehld commented 1 year ago

Greetings all,

I'm a developer at the RCSB PDB and after many discussions and considerations within our team about the tremendous value and potential of @sbliven's package, we are pleased to announce that we have taken on the responsibility to maintain and continue development of a new version of this package, rcsbsearchapi.

In order to streamline our efforts, we migrated the package to a new repository: https://github.com/rcsb/py-rcsbsearchapi. This new repository will serve as the central hub for all future development, bug fixes, and discussions related to the RCSB PDB Search API package. (N.B. This was originally created as a fork from this repository, but due to a limitation in GitHub in which newly created PRs would always by default point to this one as the base repository instead of our new one, we decided to detach it.)

In addition to this migration, we are excited to announce that we have already introduced a handful of new features (thanks to the efforts by @santiblaumann and @rushambhatt), along with fixing the original issue of updating from V1 to V2 of the RCSB.org search API (thanks to @ncoish for his patch). These include:

For a full overview of these new features (including examples), please take look at our documentation.

Importantly, please be aware that this new package introduces breaking changes that will affect your current code (the most obvious of which is the change in package name itself—i.e., import rcsbsearch should now be import rcsbsearchapi). To facilitate your transition, we strongly advise taking a look through the examples in the README or Quickstart tutorial. These examples are also available in a Jupyter notebook.

We hope that this expanded package will greatly benefit your research interests. Your feedback, questions, or contributions are warmly encouraged and appreciated. And finally, we would of course like to thank @sbliven once again for his generous efforts in designing such a comprehensive public software utility and providing the groundwork for us to build upon.

Happy coding,

Dennis

joelb123 commented 1 year ago

Thanks, this looks like what I was hoping for! I will try it out and comment in the new repo.