Welcome to OmicronServer’s documentation!¶
Contents:
Introduction¶
OmicronServer forms the back end of the Omicron Project, which aims to automate a large part of laboratory processes and record-keeping.
Audience¶
This document is intended for developers coming from a non-Python background to understand how this software works, and how to contribute additional functionality to the software.
In addition, this document is intended for reading by potential consumers of this API, in order to understand what each HTTP request in this API does.
Readme¶
Welcome to OmicronServer¶
- OmicronServer is the back end for Omicron Web Services, a project that aims
- to automate much of the process engineering and experimentation
Installation¶
A stable version of OmicronServer has not yet been released. TravisCI builds are run on all branches and pull requests with every commit, but features may be lacking in these builds. See the issues and project milestones for a timeline of future releases.
$ git clone https://github.com/MichalKononenko/OmicronServer.git
Packages and Dependencies¶
Dependencies are outlined in requirements.txt. In order to install dependencies, run
pip install -r requirements.txt
TravisCI uses this file to install all its dependencies, and Heroku uses this to identify OmicronServer as a Python project.
Since Travis runs on Linux, it has the advantage of using gcc to compile
some of the packages listed here. your machine may not have this luxury, and so
you may have to find binaries for the psycopg2
package, in order to connect to PostgreSQL
Supported Versions¶
- This project is currently supported for Python versions
- 2.7
- 3.4
- 3.5
Supported Databases¶
OmicronServer currently supports PostgreSQL and SQLite.
Running the Program¶
To run the server, run
$ python run_server.py
from the command line.
By default, the server will run on localhost:5000. The address can be specified by
setting the IP_ADDRESS and PORT environment variables in your command line.
Environment Variables¶
The file config.py will adjust its settings depending on the value of several
environment variables. These are
IP_ADDRESS: The IP address at which the server is to be hostedPORT: The port number at which the server is to be hostedBASE_DIRECTORY: The base directory whererun_server.pyis kept. By default, this is the current directory of theconfig.pyfileTOKEN_SECRET_KEY: The secret key used as a salt to generate authentication tokens for the user. Tokens are not stored onthe back end, but are generated from user data, and the value of
TOKEN_SECRET_KEY. If this value is changed, the user’s token will no longer work.
DATABASE_URL: The URL at which the database sits. This is the database to be used by the serverDEBUG: IfTRUE, then stack traces will be displayed when in the browser if the server throws a 500 errorSTATE: A generic flag for specifying betweenDEV,CI, andPRODmachines. Currently not wired to anythingLOGFILE: The file to which the log should be written. If this is notdefined, the application log will be written to
`sys.stdout`.
Command Line Parsing¶
Unfortunately, the values above must be set as environment variables as OmicronServer does not currently support parsing these arguments in the command line
License¶
This project and all files in this repository are licensed under the GNU General Public License (GPL) version 3.
A copy of this license can be found in the LICENSE file
