Skip to content

Commit

Permalink
Added setup.py and uploaded mogli to PyPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRhiem committed Oct 29, 2014
1 parent dc0f8ce commit baac59d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mogli

mogli is python module for easily rendering molecules.
mogli is a python module for easily rendering molecules.

The fastest way to get started is using mogli.py in the command line:
```
Expand All @@ -10,11 +10,13 @@ The fastest way to get started is using mogli.py in the command line:
This will open a new window in which the molecule will be rendered. You can then rotate the molecule using your mouse.

In python, you can achieve something similar with three lines of code:

```
>>> import mogli
>>> molecules = mogli.read('examples/dna.xyz')
>>> mogli.show(molecules[0])
```

![DNA rendered in a GR window](https://raw.githubusercontent.com/FlorianRhiem/mogli/doc-images/dna-cli.png)

## Atomic bonds
Expand All @@ -26,6 +28,7 @@ The second method uses a constant maximum distance instead. If you use this meth

## Exporting to files
Instead of viewing molecules interactively, you can export the molecule as well, for example as Portable Network Graphics into a `.png` file, or as HTML5 page with interactive WebGL code as `.html` file. To do so, simply call the `export()` function, like so:

```
>>> import mogli
>>> molecules = mogli.read('examples/dna.xyz')
Expand All @@ -47,6 +50,7 @@ In case you use the GR framework, you can use mogli to draw molecules into your
>>> mogli.draw(molecules[0])
>>> gr.updatews()
```

![DNA rendered in a GR window](https://raw.githubusercontent.com/FlorianRhiem/mogli/doc-images/dna-gr.png)

## Dependencies
Expand Down
50 changes: 50 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from setuptools import setup
import os.path
import shutil
import subprocess


def create_required_files():
"""
Creates the files required for building a package.
"""
# Manifest
if not os.path.isfile('MANIFEST.in'):
with open('MANIFEST.in', 'w') as manifest_in:
manifest_in.write('include *.txt\n')
manifest_in.write('include *.rst\n')

# License
if not os.path.isfile('LICENSE.txt'):
shutil.copyfile('LICENSE', 'LICENSE.txt')

# Readme in reST format
if not os.path.isfile('README.rst'):
subprocess.call(['pandoc', 'README.md', '-t', 'rst', '-o', 'README.rst'])

create_required_files()
# README.txt was created in the function above, so we can use its content for
# the long description:
with open('README.rst') as file:
long_description = file.read()

setup(name='mogli',
version='0.2.0',
description='Simple visualization of molecules in python',
long_description=long_description,
author='Florian Rhiem',
author_email='[email protected]',
url='https://github.com/FlorianRhiem/mogli',
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: Visualization',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics'
],
py_modules=['mogli'],
install_requires=['glfw', 'gr', 'numpy', 'PyOpenGL'],
)

0 comments on commit baac59d

Please sign in to comment.