# shiftpy
Tools for running Python Apps on OpenShift Red Hat Cloud
[](https://travis-ci.org/rochacbruno/shiftpy)
[](https://landscape.io/github/rochacbruno/shiftpy/master)
<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rochacbruno%40gmail%2ecom&lc=BR&item_name=ShiftPy&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest"><img alt='Donate with Paypal' src='http://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' /></a>
# installation
```pip install shiftpy```
# Available tools
- env.getvar - Get openshift env var
- env.listvars - Print all openshift env vars
- env.getallvars - Get all vars as a dict
- wsgi_utils.envify - Wrap wsgi app in Openshift Virtualenv
- **ADD YOURS, please contribute**
# getvar
```python
> from shiftpy.env import getvar
> print getvar('HOMEDIR')
'app-root/w543543543543543/home/'
```
# listvars
```python
> from shiftpy.env import listvars
> listvars()
OPENSHIFT_HOMEDIR = 'app-root/w543543543543543/home/'
OPENSHIFT_APP_NAME = 'yourappname'
...
```
# getallvars
```python
> from shiftpy.env import getallvars
> allvars = getallvars()
> print allvars
{'OPENSHIFT_FOO': 'BAR',
'OPENSHIFT_HOMEDIR': '/tmp',
'OPENSHIFT_PYTHON_DIR': '/tmp/python'}
```
# envify
This will wrap your wsgi app in virtualenv to OpenShift
```python
from shiftpy.wsgi_utils import envify
from myproject import app
# wsgi expects an object named 'application'
application = envify(app)
```
then your app will be available for wsgi_mod and virtualenv is activated
Tools for running Python Apps on OpenShift Red Hat Cloud
[](https://travis-ci.org/rochacbruno/shiftpy)
[](https://landscape.io/github/rochacbruno/shiftpy/master)
<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rochacbruno%40gmail%2ecom&lc=BR&item_name=ShiftPy&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest"><img alt='Donate with Paypal' src='http://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' /></a>
# installation
```pip install shiftpy```
# Available tools
- env.getvar - Get openshift env var
- env.listvars - Print all openshift env vars
- env.getallvars - Get all vars as a dict
- wsgi_utils.envify - Wrap wsgi app in Openshift Virtualenv
- **ADD YOURS, please contribute**
# getvar
```python
> from shiftpy.env import getvar
> print getvar('HOMEDIR')
'app-root/w543543543543543/home/'
```
# listvars
```python
> from shiftpy.env import listvars
> listvars()
OPENSHIFT_HOMEDIR = 'app-root/w543543543543543/home/'
OPENSHIFT_APP_NAME = 'yourappname'
...
```
# getallvars
```python
> from shiftpy.env import getallvars
> allvars = getallvars()
> print allvars
{'OPENSHIFT_FOO': 'BAR',
'OPENSHIFT_HOMEDIR': '/tmp',
'OPENSHIFT_PYTHON_DIR': '/tmp/python'}
```
# envify
This will wrap your wsgi app in virtualenv to OpenShift
```python
from shiftpy.wsgi_utils import envify
from myproject import app
# wsgi expects an object named 'application'
application = envify(app)
```
then your app will be available for wsgi_mod and virtualenv is activated
Release files for shiftpy 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| shiftpy-0.1.3.tar.gz | 3.8 kB | Details |
Release files / shiftpy-0.1.3.tar.gz
| Download URL | shiftpy-0.1.3.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0535518c9f3e04bc6c514a3af325daf4a4fe8c1bd84c44e927151878ddc4041
|
|
BLAKE2b-256 checksum How to use checksums |
cad9bf66ac84f3e4e4a69ea3da93a5b94029d299f6b297f204ab5ceb841d6a58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |