Swimlane Python v2.17

https://img.shields.io/pypi/v/swimlane.svg https://img.shields.io/pypi/pyversions/swimlane.svg https://travis-ci.org/swimlane/swimlane-python.svg?branch=master https://readthedocs.org/projects/swimlane-python-driver/badge/?version=latest https://api.codacy.com/project/badge/Grade/215d8281290749bba687a08db1d59d8b https://api.codacy.com/project/badge/Coverage/215d8281290749bba687a08db1d59d8b

https://github.com/swimlane/swimlane-python

Python driver for the Swimlane API

Viewing docs for release v2.17.0


Installation

Pip

Recommended installation method is to install via pip.

Install/upgrade to latest release:

pip install -U swimlane

Install/upgrade to latest release for platform v2.x:

pip install -U "swimlane>=2,<3"

Offline Installer

An installer including bundled dependencies is made available for easy offline installs

Download and run .pyz self-extracting archive from Github releases page for the correct platform and python version:

wget https://github.com/swimlane/swimlane-python/releases/download/<release>/swimlane-python-<version>-offline-installer-<platform>-<python>.pyz
python ./swimlane-python-<version>-offline-installer-<platform>-<python>.pyz

Note

Offline installer requires pip v9+, installation will fail when attempting to use an earlier version. Verify pip version with pip -V.

Git

Manually clone from Github repository, checkout, and install specific branch or release:

git clone https://github.com/swimlane/swimlane-python
cd swimlane-python
git checkout <branch>
pip install .

Note

Installing via Git will install as a working version, and should only be used for driver development. Some features like server/client version compatibility checking may not work as expected when not installing production releases.

Versioning

The Swimlane driver is versioned along with server, and will support all minor versions below installed version. The latest major release should always be installed matching the target server major version. Patch versions can float between server and driver, and may not always match.

Newer minor server releases will typically work as expected, but could have minor inconsistencies or missing features. A warning message will be logged when connecting to a newer minor server release than the current driver release, but will otherwise work as expected.

Warning

Major versions of driver and server are incompatible, and will NOT work together and will raise swimlane.exceptions.InvalidServerVersion when attempting to connect.

For example, swimlane==2.15.0 will fully support platform versions 2.0.0 - 2.15.x, will warn and attempt to work when connecting to platform 2.16.0 - 2.y.z, and will fail when connecting to platform 3.0.0+.

Usage

All connection and interaction with Swimlane API is handled via the swimlane.Swimlane client.

Connection, authentication, and any additional requests will all be handled by the client class automatically throughout the rest of the examples in the documentation.

Quick Start

from swimlane import Swimlane


# Connect Swimlane client
swimlane = Swimlane('https://192.168.1.1', 'username', 'password')


# Retrieve App by name
app = swimlane.apps.get(name='Target App')


# Create new Record
new_record = app.records.create(**{
    'Text Field': 'String',
    'Numeric Field': 100,
    'UserGroup Field': swimlane.user,
    'ValuesList Field': ['Option 1', 'Option 2']
})


# Work with field values
assert new_record['Text Field'] == 'String'

new_record['Numeric Field'] += 100
assert new_record['Numeric Field'] == 200

assert new_record['UserGroup Field'].id == swimlane.user.id