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.9+
- 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omero_user_token-0.4.1.tar.gz.
File metadata
- Download URL: omero_user_token-0.4.1.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0fa9042dbc227418092a807d25b830e1279440a8a695c8001596fa77f2f33df
|
|
| MD5 |
b678d666e415a03ab6cc8937cc6bd902
|
|
| BLAKE2b-256 |
dc706e5ecac24d27ceb9202879b031da2ec5c9b553fb0f153e023a308ea427a8
|
File details
Details for the file omero_user_token-0.4.1-py3-none-any.whl.
File metadata
- Download URL: omero_user_token-0.4.1-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
723da50f52b06f7e7573271d0e97064b1d950fe60199d3d0dac06ab931495721
|
|
| MD5 |
5a80678c546a4ee0819bb95de63660b5
|
|
| BLAKE2b-256 |
c407de4d44da0a26579987402f8e42a02ed6b14f067f355e2db23fef9501dbc5
|