Mercurial > repos > iuc > ncbi_eutils_efetch
annotate egquery.py @ 0:1b4ac594d02a draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
| author | iuc |
|---|---|
| date | Sat, 31 Oct 2015 12:44:54 -0400 |
| parents | |
| children | 2ff5369b4b51 |
| rev | line source |
|---|---|
|
0
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env python |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
2 import argparse |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
3 import eutils |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
4 |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
5 |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
6 if __name__ == '__main__': |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
7 parser = argparse.ArgumentParser(description='EGQuery', epilog='') |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
8 parser.add_argument('term', help='Query') |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
9 # |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
10 parser.add_argument('--user_email', help="User email") |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
11 parser.add_argument('--admin_email', help="Admin email") |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
12 args = parser.parse_args() |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
13 |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
14 c = eutils.Client(user_email=args.user_email, admin_email=args.admin_email) |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
15 |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
16 payload = { |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
17 'term': args.term, |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
18 } |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
19 results = c.gquery(**payload) |
|
1b4ac594d02a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 780c9984a9c44d046aadf1e316a668d1e53aa1f0
iuc
parents:
diff
changeset
|
20 print results |
