Skip to main content

Python client for the Gobbler service

Project description

Python client for the gobbler service

Unit tests Documentation PyPI-Server

Pretty much as it says on the tin; provides an Python client for the Gobbler service. It is assumed that the users of this package and the Gobbler service itself are accessing the same shared filesystem; this is typically the case for high-performance computing (HPC) clusters in scientific institutions. To demonstrate, let's spin up a mock Gobbler instance:

import pygobbler as pyg
_, staging, registry, url = pyg.start_gobbler()

Administrators are responsible for creating projects:

pyg.create_project("test", staging=staging, url=url, owners=["akari"])

An authorized user account (in this case, akari) can then upload directory of arbitrary files:

import tempfile
import os
tmp = tempfile.mkdtemp()
with open(os.path.join(tmp, "blah.txt"), "w") as f:
    f.write("BAR")
os.mkdir(os.path.join(tmp, "foo"))
with open(os.path.join(tmp, "foo", "bar.txt"), "w") as f:
    f.write("1 2 3 4 5 6 7 8 9 10")

pyg.upload_directory(
    project="test", 
    asset="foo", 
    version="bar", 
    directory=tmp,
    staging=staging, 
    url=url
)

Anyone can fetch or list the contents, either on the same filesystem or remotely via the REST API.

pyg.list_files("test", "foo", "bar", registry=registry, url=url)
pyg.fetch_manifest("test", "foo", "bar", registry=registry, url=url)
pyg.fetch_summary("test", "foo", "bar", registry=registry, url=url)
pyg.fetch_file("test/foo/bar/blah.txt", registry=registry, url=url)
pyg.version_path("test", "foo", "bar", registry=registry, url=url)

Project owners can set the permissions to allow other users to add new assets or new versions of existing assets:

pyg.set_permissions(
    "test", 
    uploaders=[ { "id": "alicia", "asset": "foo" } ], 
    registry=registry, 
    staging=staging, 
    url=url
)

# And then 'alicia' can do:
pyg.upload_directory(
    project="test", 
    asset="foo", 
    version="bar2", 
    directory=tmp,
    staging=staging, 
    url=url
)

By default, uploaders are untrusted and their uploads will be "probational". Owners can approve/reject probational uploads after review.

pyg.approve_probation("test", "foo", "bar2", staging=staging, url=url)

Finally, administrators can delete projects, though this should be done sparingly.

pyg.remove_project("test", staging=staging, url=url)

Check out the API documentation for more details on each function. For the concepts underlying the Gobbler itself, check out the repository for a detailed explanation.

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

pygobbler-0.1.9.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygobbler-0.1.9-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file pygobbler-0.1.9.tar.gz.

File metadata

  • Download URL: pygobbler-0.1.9.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygobbler-0.1.9.tar.gz
Algorithm Hash digest
SHA256 885ad5a1b793342494ab3427b854e10d9124a9de9535501cdca62ddf1173dcef
MD5 115d3a72de641752a2c5f70b84febb5c
BLAKE2b-256 0f0d9a00fe890baa3cf72a599c6fadc1238f35e09dfe004b9993923ebeb4024a

See more details on using hashes here.

File details

Details for the file pygobbler-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: pygobbler-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygobbler-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f67b9ec47331fdd3c70ee1340237a6b013271c507d4b7eee7c7cc286ff4c0266
MD5 1662b0d4174801c4e0f5f03649268098
BLAKE2b-256 b0c1d10e17ecc1d76afe6bed735b49ad868e9663fcaba7694962736e80d19dc3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page