Extract experimental properties of any PubChem compound with ease.
Documentation:
Why, indeed, do we need another PubChem-related python package? The answer is that I've found the available one not quite fitting my needs. While the mentioned package offers a wide range of possible uses and allows to retrieve various computed parameters, it does not allow to retrieve any experimental ones. So I decided to write my own package that would do exactly that!
Installation |
---|
|
or |
|
if you have several Python versions installed. |
Please keep in mind that this package is written in Python 3, so, sadly, it won't work if you only have Python 2.x installed. Raise an issue if you'd like to see this kind of back-version support implemented, though, and we will see what we can do. :) |
======= |
Usage |
======= |
|
where X is one of the following functions: |
- get_cid_by_name – takes a compound name, searches PubChem for it and returns it's PubChem ID |
- get_first_layer_props – takes a compound name and a list of required parameters that CAN be retreived directly using the amazing PubChem PUG REST API |
|
------------------------------------ |
Getting the Compund ID (CID) by name |
This is a pretty simple task, but it may be useful if you would like to do something else with PubChem – that is, something this module cannot yet do. |
Use it like that: |
|
The function accepts a compound's name (can be either IUPAC or rational) and returns its PubChem CID. |
|
----------------------- |
What's with the layers? |
Just couldn't find any better name for that :] PRs much welcomed if you have another suggestion, though. |
Basically what it means is that first layer properties are easy to retrieve, because there is a clear API for that. Here is the list of these properties: |
|
Whoa, ain't that a hell of a lot of properties? And you can ask for any of those with the |
|
|
|
Okay, now moving on to the second layer. The name presumes that these properties are much harder to retrieve and you have to dig deeper to get to them. There is no direct API to acceess them or present them in a nice way. Still there are some pretty much interesting properties that you can get out of that: |
|
Also pretty big list, right? And you can get retrieve any property you like using the |
|
|
|
Looking messier than the first layer props return, but I didn't call 'em the second layer props for no reason, you see. :) |
Still this is much better than having no info at all! |
===== |
TODOs |
There is still a lot of work to be done:
- Add error handlers – oftentimes users will not provide a correct compound name due to typos or whatever, so we'd need to add some handlers for that. Ain't got none at the moment.
- Add more functionality – there are still lots of things one can retrieve from PubChem: images, spectra, bioinformation...
- Write better docs maybe
- Make the data returned look better and easier to read
- ???
- PROFIT!
PRs are very much welcomed, also feel free to open any issues or start discussions.
Hope you like the package!