Mercurial > repos > iuc > ncbi_eutils_efetch
comparison epost.py @ 0:71bcf87a7031 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 15bcc5104c577b4b9c761f2854fc686c07ffa9db
author | iuc |
---|---|
date | Thu, 07 Jul 2016 02:39:36 -0400 |
parents | |
children | 0fc65a60436f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:71bcf87a7031 |
---|---|
1 #!/usr/bin/env python | |
2 import argparse | |
3 import eutils | |
4 | |
5 | |
6 if __name__ == '__main__': | |
7 parser = argparse.ArgumentParser(description='EPost', epilog='') | |
8 parser.add_argument('db', help='Database to use') | |
9 parser.add_argument('--id_list', help='list of ids') | |
10 parser.add_argument('--id', help='Comma separated individual IDs') | |
11 parser.add_argument('--history_file', help='Post to new QueryKey in an existing WebEnv') | |
12 parser.add_argument('--user_email', help="User email") | |
13 parser.add_argument('--admin_email', help="Admin email") | |
14 | |
15 args = parser.parse_args() | |
16 | |
17 c = eutils.Client(history_file=args.history_file, user_email=args.user_email, admin_email=args.admin_email) | |
18 merged_ids = c.parse_ids(args.id_list, args.id, args.history_file) | |
19 | |
20 payload = {} | |
21 if args.history_file is not None: | |
22 payload.update(c.get_history()) | |
23 else: | |
24 payload['id'] = ','.join(merged_ids) | |
25 payload['WebEnv'] = '' | |
26 | |
27 print c.post(args.db, **payload) |