diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..04f196a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include README.md +include LICENSE diff --git a/README.md b/README.md index 4dda4ea..90df29b 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,34 @@ # PubChemPy -A Python interface for the [PubChem PUG REST service](http://pubchem.ncbi.nlm.nih.gov/pug_rest/PUG_REST.html). +A simple Python wrapper around the [PubChem PUG REST API](http://pubchem.ncbi.nlm.nih.gov/pug_rest/PUG_REST.html). + +## Installation + +**Option 1**: Use [pip](http://www.pip-installer.org/en/latest/). + + pip install PubChemPy + +**Option 2**: [Download the latest release](https://pypi.python.org/packages/source/P/PubChemPy/PubChemPy-1.0.tar.gz) and install yourself: + + tar xzvf PubChemPy-1.0.tar.gz + cd PubChemPy-1.0 + sudo python setup.py install + +**Option 3**: [Download pubchempy.py](https://github.com/mcs07/PubChemPy/raw/master/pubchempy.py) and manually place it in your project directory or anywhere on your PYTHONPATH. + +**Option 4**: Get the latest development version by cloning the Git repository. + + git clone https://github.com/mcs07/PubChemPy.git ## Basic usage -To use PubChemPy in your Python script, just import it and make use of the functions and classes that it provides. +PubChemPy provides a variety of functions and classes that allow you to retrieve information from PubChem. from pubchempy import * c = Compound.from_cid(1423) cs = get_compounds('Aspirin', 'name') - - ## Substances and compounds The `get_substances` and `get_compounds` functions allow retrieval of PubChem Substance and Compound records. The functions take a wide variety of inputs, and return a list of results, even if only a single match was found. @@ -27,7 +43,7 @@ A second `namespace` argument allows you to use different types of input: get_compounds('Aspirin', 'name') get_compounds('C1=CC2=C(C3=C(C=CC=N3)C=C2)N=C1', 'smiles') -Beware that line notation inputs like SMILES and InChI can return records that aren't actually present in PubChem, and therefore have no CID or SID and are missing many properties. +Beware that line notation inputs like SMILES and InChI can return automatically generated records that aren't actually present in PubChem, and therefore have no CID or SID and are missing many properties. By default, compounds are returned with 2D coordinates. Use the `record_type` keyword argument to specify otherwise: diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..79a6a80 --- /dev/null +++ b/setup.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +import os +from distutils.core import setup + +import pubchempy + + +if os.path.exists('README.txt'): + long_description = open('README.txt').read() +else: + long_description = open('README.md').read() + +setup( + name='PubChemPy', + version=pubchempy.__version__, + author=pubchempy.__author__, + author_email=pubchempy.__email__, + license=pubchempy.__license__, + url='https://github.com/mcs07/PubChemPy', + py_modules=['pubchempy'], + description='A simple Python wrapper around the PubChem PUG REST API.', + long_description=long_description, + keywords='pubchem python rest api pug', + classifiers=[ + 'Intended Audience :: Science/Research', + 'Intended Audience :: Healthcare Industry', + 'Intended Audience :: Developers', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Bio-Informatics', + 'Topic :: Scientific/Engineering :: Chemistry', + 'Topic :: Database :: Front-Ends', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Internet', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2.7', + ], +)