comparison list_organisms.py @ 0:f889e757ca93 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:45:08 -0400
parents
children 356b43302b16
comparison
equal deleted inserted replaced
-1:000000000000 0:f889e757ca93
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))