Skip to content

Mayo-QIN/pygrunt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

PyGrunt

Pygrunt contains a class that utilizes the request library to interact with grunt dockers.

Start up an example docker

docker fetch mayoqin/grunt
docker run --rm -it -p 9901:9901 mayoqin/grunt

Interface with the docker

from pygrunt import *

g = grunt("http://localhost:9901")

# list available services
for service in g.services.keys():
    print service

# Try out the "echo service"
j = g.echo
j.Message = "Hi from grunt"

# Submit the job to grunt, and wait for completion
job = j()
job.wait()

print "got output! {}".format ( job.output() )

# Wait for a job
j = g.sleep
j.seconds = 10
job = j()
job.wait()

# Upload and download data
j = g.copy
j.input = 'README.md'
j.output = 'README.copy.md'

job = j()
job.wait()
# writes READEM.copy.md to current directory.
job.save_output ( 'output', directory='.' )

About

A python library to interact with grunt

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages