OASA is a python library for manipulation of chemical formats that forms the base of BKChem.

Until very recently, it was used solely by BKChem and some of my private projects. However because there seems to be some demand for a library that can draw chemical structures to PNG, I decided to publish OASA separately from BKChem from time to time.

Even though OASA is already some 4 years old project, its API may be unstable. This is mainly because it was never before released outside of BKChem and I followed all significant API changes there. Therefore please do not expect a highly polished, well documented library. OASA is probably rather the opposite. You have been warned.


Missing features

Sample export

This is an example of PNG export:
PNG output example
The same molecule is here in PDF and SVG.



The latest release is oasa-0.13.1.

Older releases are available here.

A kind of ChangeLog is available here.

Windows package

There is also a special package for Windows systems available. It is no sophisticated auto-installer, but it contains a working copy of cairo for Windows, which might come handy.

To install this version, just copy the two directories oasa and cairo from the package directory either inside your projects directory or into a system wide location, such as C:\Python25\Lib\site-packages\. You can test if it works for you by running the test.py script from the distribution directory. It should create an image file called test.png.

The windows package is created for Python 2.5 (or 2.6, see below), however the only version dependent part of the package is the file cairo\_cairo.pyd. Replacing this file by the included cairo\_cairo.pyd2.4 should make the package work with Python 2.4.

You can download the windows packages for Python 2.5 here or Python 2.6 here.