EduceLab Globus module
Project description
EduceLab Globus
educelab-globus is a Python module and command-line toolkit for logging into
and transferring data between Globus endpoints. It
wraps globus-sdk with a small configuration file, named endpoints, and three
ergonomic CLI commands that make scripted transfers between lab and archive
systems straightforward.
Features
- A simple TOML-based config of named Globus endpoints with optional default base directories
- A login command that acquires and caches tokens, prompts for any required
consents (including
data_accessand session/MFA requirements), and falls back automatically to a headless flow on remote shells - A
cp-style command for copying files and directories between endpoints, with progress reporting, sync modes, optional checksum verification, and a background submit mode - A small Python API for use from other tools and pipelines
Requirements
- Python 3.10+
globus-sdk4.0+prompt-toolkit
Installation
This project is available on PyPI:
python3 -m pip install educelab-globus
Quick start
1. Configure your endpoints
Named Globus endpoints are stored in ~/.globuscp/config.toml:
[lab-server]
uuid = "16fd2706-8baf-433b-82eb-8c7fada847da"
basedir = "/mnt/scratch/" # optional, defaults to /
[archive]
uuid = "f47ac10b-58cc-4372-a567-0e02b2c3d479"
basedir = "/cold/"
basedir is optional. When omitted, absolute paths must be given explicitly
on the command line and relative paths are not allowed.
You can also use the interactive editor:
el-globus-config --edit
2. Log in
el-globus-login
Tokens are cached in ~/.globuscp/tokenstore.json. Subsequent commands reuse
them until they expire or an endpoint requires new consents.
3. Transfer data
el-globus-cp lab-server:data/experiment-01 archive:backups/2024/experiment-01
CLI reference
# List configured endpoints
el-globus-config
# Interactively add, edit, or delete endpoints
el-globus-config --edit
# Login to Globus and cache access tokens
el-globus-login
# Login for specific endpoints only
el-globus-login --endpoints endpoint-name-or-uuid [...]
# Force a new login, even if cached tokens are valid
el-globus-login --force
# Print the auth URL instead of opening a browser (useful over SSH)
el-globus-login --no-browser
# Transfer a file or directory between two endpoints.
# Paths may be absolute or relative to the endpoint's basedir.
el-globus-cp src-endpoint:/path/to/source dst-endpoint:/path/to/dest
# Examples
el-globus-cp lab-server:data/experiment-01 archive:backups/2024/experiment-01
el-globus-cp lab-server:/mnt/scratch/run42 archive:/cold/run42
# Only transfer files that have changed (other choices: exists, size, checksum)
el-globus-cp --sync-level mtime src:data/ dst:data/
# Enable checksum verification
el-globus-cp --verify src:data/ dst:data/
# Background mode: exit immediately after submitting the transfer
el-globus-cp --background src:data/ dst:data/
All commands accept --verbose/-v and --quiet/-q to control log output.
Python API
from educelab.globus import login, endpoints, get_endpoint
# List configured endpoints
print(endpoints())
# Look up a single endpoint by name
ep = get_endpoint('lab-server')
# Log in and obtain a globus_sdk.TransferClient
tc = login([ep['uuid']])
See the full API documentation for details.
Documentation
Full documentation is hosted on Read the Docs: https://educelab-globus.readthedocs.io
License
This project is licensed under the GNU Affero General Public License v3.0. See LICENSE and NOTICE for details.
Project details
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 educelab_globus-1.0.0.tar.gz.
File metadata
- Download URL: educelab_globus-1.0.0.tar.gz
- Upload date:
- Size: 30.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e08b51b87d61e864797fd0b62ee0ac1fa3f50b390178eb2d7932f6baf11988dd
|
|
| MD5 |
29bccc60caf795825844678453088fcd
|
|
| BLAKE2b-256 |
846abe52b7b55e10ed125f07f080b1cfe877ff9f52df89e782b23cd8707a3c92
|
Provenance
The following attestation bundles were made for educelab_globus-1.0.0.tar.gz:
Publisher:
publish.yml on educelab/educelab-globus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
educelab_globus-1.0.0.tar.gz -
Subject digest:
e08b51b87d61e864797fd0b62ee0ac1fa3f50b390178eb2d7932f6baf11988dd - Sigstore transparency entry: 1783003391
- Sigstore integration time:
-
Permalink:
educelab/educelab-globus@cc9335db114f4e6c8b5a181c1ff8385495e78a93 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/educelab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc9335db114f4e6c8b5a181c1ff8385495e78a93 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file educelab_globus-1.0.0-py3-none-any.whl.
File metadata
- Download URL: educelab_globus-1.0.0-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23947adf8a847e2d6994e177e945e0bc800411812968a77880f3b2d8938312c0
|
|
| MD5 |
2dab63aa7a2d622cd7add3560b7f079a
|
|
| BLAKE2b-256 |
222fad042ddce728770676d55477e5a3bcb72b970a90f5aadca051d1d2e0397d
|
Provenance
The following attestation bundles were made for educelab_globus-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on educelab/educelab-globus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
educelab_globus-1.0.0-py3-none-any.whl -
Subject digest:
23947adf8a847e2d6994e177e945e0bc800411812968a77880f3b2d8938312c0 - Sigstore transparency entry: 1783003566
- Sigstore integration time:
-
Permalink:
educelab/educelab-globus@cc9335db114f4e6c8b5a181c1ff8385495e78a93 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/educelab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc9335db114f4e6c8b5a181c1ff8385495e78a93 -
Trigger Event:
workflow_dispatch
-
Statement type: