Swimlane Python v10.12¶
https://github.com/swimlane/swimlane-python
Python driver for the Swimlane API
Viewing docs for release v10.12.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 python driver is versioned along with the Swimlane product version, and will support all minor versions below installed version. The latest major release should always be installed matching the target server major build version. Patch version is reserved for driver fixes, and is not related to Swimlane server version.
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 Swimlane versions 2.0 - 2.15, will warn and attempt to work when connecting to versions 2.16 - 2.x, and will fail when connecting to versions 3.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 outside of Swimlane
swimlane = Swimlane('https://192.168.1.1', 'username', 'password')
# Connect Swimlane client from Python task in Swimlane
swimlane = Swimlane(sw_context.config['InternalSwimlaneUrl'],'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
Examples¶
Complete examples and descriptions of all driver functionality
Package Docs¶
Full API documentation for all package components
- swimlane package
- swimlane.core package
- swimlane.core.adapters package
- swimlane.core.adapters.app module
- swimlane.core.adapters.app_revision module
- swimlane.core.adapters.helper module
- swimlane.core.adapters.record module
- swimlane.core.adapters.record_revision module
- swimlane.core.adapters.report module
- swimlane.core.adapters.task module
- swimlane.core.adapters.usergroup module
- swimlane.core.fields package
- swimlane.core.fields.base package
- swimlane.core.fields.attachment module
- swimlane.core.fields.comment module
- swimlane.core.fields.datetime module
- swimlane.core.fields.history module
- swimlane.core.fields.list module
- swimlane.core.fields.number module
- swimlane.core.fields.reference module
- swimlane.core.fields.text module
- swimlane.core.fields.tracking module
- swimlane.core.fields.usergroup module
- swimlane.core.fields.valueslist module
- swimlane.core.resources package
- swimlane.core.resources.app module
- swimlane.core.resources.app_revision module
- swimlane.core.resources.attachment module
- swimlane.core.resources.base module
- swimlane.core.resources.comment module
- swimlane.core.resources.record module
- swimlane.core.resources.record_revision module
- swimlane.core.resources.report module
- swimlane.core.resources.revision_base module
- swimlane.core.resources.task module
- swimlane.core.resources.usergroup module
- swimlane.core.bulk module
- swimlane.core.cache module
- swimlane.core.client module
- swimlane.core.cursor module
- swimlane.core.resolver module
- swimlane.core.search module
- swimlane.core.wrappedsession module
- swimlane.core.adapters package
- swimlane.utils package
- swimlane.exceptions module
- swimlane.core package