comparison list_organisms.py @ 0:c6d7f19953a6 draft

planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit f745b23c84a615bf434d717c8c0e553a012f0268
author gga
date Mon, 11 Sep 2017 05:47:25 -0400
parents
children 1a2976c6b161
comparison
equal deleted inserted replaced
-1:000000000000 0:c6d7f19953a6
1 #!/usr/bin/env python
2 from __future__ import print_function
3
4 import argparse
5 import json
6
7 from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms
8
9 if __name__ == '__main__':
10 parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance')
11 WAAuth(parser)
12 parser.add_argument('email', help='User Email')
13 args = parser.parse_args()
14
15 wa = WebApolloInstance(args.apollo, args.username, args.password)
16
17 gx_user = AssertUser(wa.users.loadUsers(email=args.email))
18 all_orgs = wa.organisms.findAllOrganisms()
19
20 orgs = accessible_organisms(gx_user, all_orgs)
21
22 print(json.dumps(orgs, indent=2))