Skip to content

Library development

Alexander Hiam edited this page Feb 4, 2014 · 2 revisions

The PyBBIO library scheme is not only directed at ease of use, but also ease of development. All PyBBIO libraries are stored in the libraries/ directory, which is found in the root PyBBIO/ directory. When PyBBIO is installed, the path to libraries/ is added to the config file, i.e. /path/to/PyBBIO/libraries/, so it will work wherever the PyBBIO/ directory lives, as long as it is kept in it. When PyBBIO is imported, whether through from bbio import * or just import bbio, the libraries/ directory is added to the Python search path for that program, meaning any Python module or package in it can then be imported. This way, all that is required to create a new PyBBIO library is to save it in libraries/; PyBBIO does not need to be reinstalled.


####Writing a library: Check out the Library tutorial.

####Submitting a library: Wrote a cool library that should be part of PyBBIO? Great! First, you should make sure your library follows these basic guidelines:

  • It's a Package (not a single file).
  • It contains some sort of README file which at least credits you as the author and provides instructions for anything not totally obvious.
  • If it has its own license it can be sublicensed by the Apache 2.0 license.
  • The code is neat and commented!

The best way to submit a library is to fork PyBBIO, add your library, then send a pull request, though you can also just email it to me at hiamalexander@gmail.com and I'll add it.