mirror of
https://github.com/openbabel/openbabel.git
synced 2026-07-29 15:54:46 -05:00
Add proper python README
- Convert README to restructuredtext format so it displays correctly on PyPI - Update email address to current mailing list - Tidy up setup.py
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
include README
|
||||
include README.rst
|
||||
include *.py
|
||||
include *.i
|
||||
include *.html
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
OpenBabel Python bindings version 1.6
|
||||
=====================================
|
||||
|
||||
This is a Python interface to the Open Babel chemistry library.
|
||||
|
||||
Open Babel is a chemical toolbox designed to speak the many languages
|
||||
of chemical data. It's an open, collaborative project allowing anyone
|
||||
to search, convert, analyze, or store data from molecular modeling,
|
||||
chemistry, solid-state materials, biochemistry, or related areas.
|
||||
|
||||
The wrapper is generated using the SWIG package and provides access to
|
||||
almost all of the Open Babel interfaces via Python, including the base
|
||||
classes OBMol, OBAtom, OBBond, and OBResidue, as well as the
|
||||
conversion framework OBConversion.
|
||||
|
||||
For installation instructions, tutorials and examples, please visit the Open Babel website:
|
||||
<http://openbabel.org/wiki/Python>
|
||||
|
||||
DEPENDENCIES
|
||||
|
||||
python-2.4 or a more recent version.
|
||||
openbabel-2.3.0 or a more recent version.
|
||||
|
||||
COPYRIGHT AND LICENSE
|
||||
|
||||
Copyright (C) 2005-2007 Geoffrey R. Hutchison <babel@geoffhutchison.net>
|
||||
Some portions Copyright (C) 2006-2010 Noel O'Boyle
|
||||
|
||||
This Python module is part of the Open Babel project.
|
||||
<http://openbabel.org/>
|
||||
|
||||
Open Babel is distributed under the GNU General Public License (GPL).
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation version 2 of the License. Full details
|
||||
can be found in the file "COPYING" which should be included in your
|
||||
distribution.
|
||||
@@ -0,0 +1,75 @@
|
||||
Open Babel Python Bindings
|
||||
==========================
|
||||
|
||||
This is a Python interface to the Open Babel chemistry library.
|
||||
|
||||
Open Babel is a chemical toolbox designed to speak the many languages
|
||||
of chemical data. It's an open, collaborative project allowing anyone
|
||||
to search, convert, analyze, or store data from molecular modeling,
|
||||
chemistry, solid-state materials, biochemistry, or related areas.
|
||||
|
||||
For installation instructions, tutorials and examples, please visit the
|
||||
`Open Babel website <http://openbabel.org/wiki/Python>`_.
|
||||
|
||||
This package provides two Python modules that can be used to access the
|
||||
functionality of Open Babel toolkit:
|
||||
|
||||
- The `openbabel <http://openbabel.org/docs/dev/UseTheLibrary/PythonDoc.html>`_
|
||||
module: A wrapper that is automatically generated using the SWIG package
|
||||
and provides access to almost all of the Open Babel interfaces via Python,
|
||||
including the base classes OBMol, OBAtom, OBBond, and OBResidue, as well
|
||||
as the conversion framework OBConversion.
|
||||
|
||||
- The `pybel <http://openbabel.org/docs/dev/UseTheLibrary/Python_Pybel.html>`_
|
||||
module: A lightweight wrapper around the classes and methods in the
|
||||
openbabel module. Pybel provides more convenient and Pythonic ways to
|
||||
access the Open Babel toolkit.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
- Python 2.4 or a more recent version.
|
||||
- Open Babel 2.3.0 or a more recent version.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
**Option 1**: Use `pip <http://www.pip-installer.org/en/latest/>`_.
|
||||
|
||||
::
|
||||
|
||||
pip install openbabel
|
||||
|
||||
**Option 2**: Download the latest release and install yourself.
|
||||
|
||||
::
|
||||
|
||||
tar -xzvf openbabel-1.8.tar.gz
|
||||
cd openbabel-1.8
|
||||
python setup.py install
|
||||
|
||||
**Option 3**: While building Open Babel itself.
|
||||
|
||||
::
|
||||
|
||||
cd openbabel
|
||||
mkdir ob-build
|
||||
cd ob-build
|
||||
cmake -DRUN_SWIG=ON -DPYTHON_BINDINGS=ON ..
|
||||
make install
|
||||
|
||||
Copyright and Licence
|
||||
---------------------
|
||||
|
||||
- Copyright (C) 2005-2007 Geoffrey R. Hutchison babel@geoffhutchison.net
|
||||
- Some portions Copyright (C) 2006-2010 Noel O'Boyle
|
||||
|
||||
This Python module is part of the `Open Babel project
|
||||
<http://openbabel.org/>`_.
|
||||
|
||||
Open Babel is distributed under the GNU General Public License (GPL).
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation version 2 of the License. Full details
|
||||
can be found in the file "COPYING" which should be included in your
|
||||
distribution.
|
||||
+64
-55
@@ -1,77 +1,86 @@
|
||||
#!/usr/bin/env python
|
||||
from setuptools import setup, Extension
|
||||
import os,sys,shutil
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
about = """The Open Babel package provides a Python wrapper
|
||||
to the Open Babel C++ chemistry library. Open Babel is a chemical
|
||||
toolbox designed to speak the many languages of chemical data. It's an
|
||||
open, collaborative project allowing anyone to search, convert,
|
||||
analyze, or store data from molecular modeling, chemistry, solid-state
|
||||
materials, biochemistry, or related areas. It provides a broad base of
|
||||
chemical functionality for custom development.
|
||||
"""
|
||||
version = "1.8"
|
||||
|
||||
__author__ = 'Noel O\'Boyle'
|
||||
__email__ = 'openbabel-discuss@lists.sourceforge.net'
|
||||
__version__ = '1.8'
|
||||
__license__ = 'GPL'
|
||||
|
||||
|
||||
if os.path.exists('README.rst'):
|
||||
long_description = open('README.rst').read()
|
||||
else:
|
||||
long_description = '''
|
||||
The Open Babel package provides a Python wrapper to the Open Babel C++ chemistry library. Open Babel is a
|
||||
chemical toolbox designed to speak the many languages of chemical data. It's an open, collaborative project
|
||||
allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state
|
||||
materials, biochemistry, or related areas. It provides a broad base of chemical functionality for custom
|
||||
development.
|
||||
'''
|
||||
|
||||
try:
|
||||
subprocess.check_output("pkg-config --exists openbabel-2.0".split())
|
||||
subprocess.check_output('pkg-config --exists openbabel-2.0'.split())
|
||||
except:
|
||||
print ("pkg-config could not find an openbabel instal. Please install openbabel and rerun setup.py.")
|
||||
print ('pkg-config could not find an openbabel install. Please install openbabel and rerun setup.py.')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
babel_version = subprocess.Popen("pkg-config --modversion openbabel-2.0".split(),
|
||||
stdout=subprocess.PIPE).stdout.readline().decode("utf-8")
|
||||
babel_version = subprocess.Popen('pkg-config --modversion openbabel-2.0'.split(),
|
||||
stdout=subprocess.PIPE).stdout.readline().decode('utf-8')
|
||||
|
||||
include_dirs = subprocess.Popen("pkg-config --variable=pkgincludedir openbabel-2.0".split(),
|
||||
stdout=subprocess.PIPE).stdout.readline().decode("utf-8").split()
|
||||
include_dirs = subprocess.Popen('pkg-config --variable=pkgincludedir openbabel-2.0'.split(),
|
||||
stdout=subprocess.PIPE).stdout.readline().decode('utf-8').split()
|
||||
|
||||
lib_dirs = subprocess.Popen("pkg-config --variable=libdir openbabel-2.0".split(),
|
||||
stdout=subprocess.PIPE).stdout.readline().decode("utf-8").split()
|
||||
lib_dirs = subprocess.Popen('pkg-config --variable=libdir openbabel-2.0'.split(),
|
||||
stdout=subprocess.PIPE).stdout.readline().decode('utf-8').split()
|
||||
|
||||
#Code should be added here to ensure these directories exist, and that this version of babel is compatible
|
||||
#with this python package.
|
||||
|
||||
swig_opts = ["-c++", "-small", "-O", "-templatereduce", "-naturalvar"]
|
||||
swig_opts += ["-I%s" % i for i in include_dirs]
|
||||
swig_opts = ['-c++', '-small', '-O', '-templatereduce', '-naturalvar']
|
||||
swig_opts += ['-I%s' % i for i in include_dirs]
|
||||
|
||||
obextension = Extension('_openbabel',
|
||||
['openbabel-python.i'],
|
||||
include_dirs=include_dirs,
|
||||
library_dirs=lib_dirs,
|
||||
swig_opts=swig_opts,
|
||||
libraries=['openbabel'])
|
||||
|
||||
obExtension = Extension('_openbabel',
|
||||
["openbabel-python.i"],
|
||||
include_dirs=include_dirs,
|
||||
library_dirs=lib_dirs,
|
||||
swig_opts=swig_opts,
|
||||
libraries=["openbabel"]
|
||||
)
|
||||
|
||||
setup(name='openbabel',
|
||||
zip_safe=True,
|
||||
version=version,
|
||||
author='Noel O\'Boyle',
|
||||
author_email='openbabel-scripting@lists.sourceforge.net',
|
||||
version=__version__,
|
||||
author=__author__,
|
||||
author_email=__email__,
|
||||
license=__license__,
|
||||
url='http://openbabel.org/',
|
||||
license='http://www.gnu.org/copyleft/gpl.html',
|
||||
py_modules=['openbabel','pybel'],
|
||||
ext_modules=[obExtension],
|
||||
description = 'openbabel: Python interface to the Open Babel chemistry library',
|
||||
description='Python interface to the Open Babel chemistry library',
|
||||
long_description=long_description,
|
||||
zip_safe=True,
|
||||
py_modules=['openbabel', 'pybel'],
|
||||
ext_modules=[obextension],
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Console',
|
||||
'Environment :: Other Environment',
|
||||
'Intended Audience :: Education',
|
||||
'Intended Audience :: Science/Research',
|
||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Natural Language :: English',
|
||||
'Operating System :: MacOS :: MacOS X',
|
||||
'Operating System :: Microsoft :: Windows',
|
||||
'Operating System :: OS Independent',
|
||||
'Operating System :: POSIX',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Operating System :: Unix',
|
||||
'Programming Language :: C++',
|
||||
'Programming Language :: Python',
|
||||
'Topic :: Scientific/Engineering :: Bio-Informatics',
|
||||
'Topic :: Scientific/Engineering :: Chemistry',
|
||||
'Topic :: Software Development :: Libraries',
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Console',
|
||||
'Environment :: Other Environment',
|
||||
'Intended Audience :: Education',
|
||||
'Intended Audience :: Science/Research',
|
||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Natural Language :: English',
|
||||
'Operating System :: MacOS :: MacOS X',
|
||||
'Operating System :: Microsoft :: Windows',
|
||||
'Operating System :: OS Independent',
|
||||
'Operating System :: POSIX',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Operating System :: Unix',
|
||||
'Programming Language :: C++',
|
||||
'Programming Language :: Python',
|
||||
'Topic :: Scientific/Engineering :: Bio-Informatics',
|
||||
'Topic :: Scientific/Engineering :: Chemistry',
|
||||
'Topic :: Software Development :: Libraries',
|
||||
],
|
||||
long_description = about,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user