Code Monkey home page Code Monkey logo

f00a4bd3c45f92afb7941215d1bc23f2a324e189736439c149cbe48e6df5637c's Introduction

galaxy-api-python-client

This is a collection of Python scripts demonstrating use of Galaxy's REST API.

Installation

If you don't already have pip installed, do that now:

sudo easy_install pip

If you do have pip installed, make sure you have an up-to-date version installed:

pip install --upgrade pip

Install the required Python packages:

pip install -r requirements.txt

Initialise the local settings:

cp examples/settings_local.py.dist examples/settings_local.py

Any setting specified here overrides the respective setting defined in settings.py.

Examples

Run everything

python examples/play_game.py

Game creation

python examples/create_game.py

User creation

python examples/create_user.py

Leaderboard creation

python examples/create_leaderboard.py

Leaderboard score creation

python examples/create_leaderboard_score.py

Example output

%% python examples/play_game.py


*******************************************************************************


Request body:

{
  "app_url": "http://www.fullscreenpokemon.com/", 
  "slug": "pokemon", 
  "description": "Full Screen Pokemon is an open source HTML5 remake of the original Pokemon games. You can play the original two generations (Red/Blue through Crystal), literally billions of procedurally generated maps, or create your own using the level editor.", 
  "name": "Pok\u00e9mon"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "slug": "pokeballs-collected", 
  "description": "This keeps track of how many pok\u00e9balls a user finds.", 
  "name": "Pok\u00e9balls Collected"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 39, 
  "user": "bill"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 50, 
  "user": "cvan"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 72, 
  "user": "david"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 84, 
  "user": "toby"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 99, 
  "user": "mark"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 101, 
  "user": "rick"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

{
  "score": 4, 
  "user": "wil"
}


Response status code:

200


Response body:

{
  "success": true
}


*******************************************************************************


Request body:

N/A


Response status code:

200


Response body:

[
  {
    "member": "rick", 
    "score": "101"
  }, 
  {
    "member": "mark", 
    "score": "99"
  }, 
  {
    "member": "toby", 
    "score": "84"
  }, 
  {
    "member": "david", 
    "score": "72"
  }, 
  {
    "member": "cvan", 
    "score": "50"
  }, 
  {
    "member": "bill", 
    "score": "39"
  }, 
  {
    "member": "wil", 
    "score": "4"
  }
]


*******************************************************************************


f00a4bd3c45f92afb7941215d1bc23f2a324e189736439c149cbe48e6df5637c's People

Contributors

cvan avatar gsathya avatar mozilla-github-standards avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.