OMERO user token management system
Project description
OMERO user token
Python package that creates long running user tokens for use with the OMERO API under non-interactive, headless conditions.
Requirements
- Python 3.6+
- OMERO.server 5.6
Usage
Creating a user token and making it active:
omero_user_token set
Please see omero_user_token set --help
for detailed information. The
default server hostname and port can be set in
${HOME}/.omero_user_token/config
using an INI file compatible style:
[server]
host = omero.example.com
port = 4064
Retrieving the current active token (validation will be performed):
omero_user_token get
Token format
The token format is as follows:
<omero_session_key>@<host>:<port>
Example usage
Bash:
token=$(omero_user_token get)
if [ $? -ne 0]; then
echo "No valid token found"
exit 1
fi
key=$(echo "${token}" | sed -e 's/^\(.*\)@.*:.*$/\1/')
host=$(echo "${token}" | sed -e 's/^.*@\(.*\):.*$/\1/')
port=$(echo "${token}" | sed -e 's/^.*@.*:\(.*\)$/\1/')
echo "Connecting to ${host}:${port} with key ${key}"
Python:
from omero_user_token import getter
token = getter()
if token is not None:
omero_session_key = token[:token.find('@')]
host, port = token[token.find('@') + 1:].split(':')
port = int(port)
key = token[:token.find('@')]
print(f"Connecting to {host}:{port} with key {key}")
License
OMERO user token is distributed under the terms of the GPL v2 license.
Please see LICENSE.txt
for further details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file omero-user-token-0.3.0.tar.gz
.
File metadata
- Download URL: omero-user-token-0.3.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22842c7dd00e264f340605d0c595c8ca0d83742728ac231b3ca53153a18505b0 |
|
MD5 | 374818258694487062b9aba8f1079c6c |
|
BLAKE2b-256 | bf59fbfba04b68d0a9d13d5a7d24e9831d027c68deb99f0738f5dd52082a8436 |
File details
Details for the file omero_user_token-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: omero_user_token-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cd36d138063e077810573f97496eb62d03a2f6cfb92c86ac3ee48c4f2e7a3f7 |
|
MD5 | 00cb0c1a92b797ecb8239f07eb7e3530 |
|
BLAKE2b-256 | e40be5eccc0d83993ac64e4b5a0284a8c113fe0ab464557d263e4ca7e1b98696 |