Skip to main content

Python helper functions for using the UNICORE REST API

Project description

# # Python library for using the UNICORE REST API #

See LICENSE file for licensing information

For full documentation of the REST API, see https://sourceforge.net/p/unicore/wiki/REST_API

For more information about the Human Brain Project, see https://www.humanbrainproject.eu/

# Getting started with pyUNICORE

Install from PyPI with

pip install -U pyunicore

Sample code to create a client for a UNICORE site

import pyunicore.client as unicore_client import json, b64encode

base_url = “https://localhost:8080/DEMO-SITE/rest/core

# authenticate with username/password token = b64encode(b”demouser:test123”).decode(“ascii”) transport = unicore_client.Transport(token, oidc=False)

client = unicore_client.Client(transport, base_url) print(json.dumps(client.properties, indent = 2))

# Running a sample job and reading result data

my_job = {‘Executable’: ‘date’}

job = site.new_job(job_description=my_job, inputs=[]) print(json.dumps(job.properties, indent = 2))

job.poll() # wait for job to finish

work_dir = job.working_dir print(json.dumps(work_dir.properties, indent = 2))

stdout = work_dir.stat(“/stdout”) print(json.dumps(stdout.properties, indent = 2))

content = stdout.raw().read() print(content)

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

pyunicore-0.6.0.tar.gz (29.3 kB view details)

Uploaded Source

File details

Details for the file pyunicore-0.6.0.tar.gz.

File metadata

  • Download URL: pyunicore-0.6.0.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.15

File hashes

Hashes for pyunicore-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4eecf65ab9ec4a0387946e6c0a102524114a8242b95b09f50be50bc23c7af3cd
MD5 7ee6b4e4fc2dc0f657b5babe56b5cf55
BLAKE2b-256 2029adb025696ad171e316e3692d66f415a6651b3a671c4b156f1b4830f5fbe6

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