Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 274 additions & 2 deletions cli-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20595,9 +20595,24 @@
}
],
"columns": [
"field",
"value"
"pmid",
"title",
"authors",
"journal",
"year",
"date",
"article_type",
"language",
"doi",
"pmc",
"affiliations",
"grants",
"mesh_terms",
"keywords",
"abstract",
"url"
],
"defaultFormat": "plain",
"type": "js",
"modulePath": "pubmed/article.js",
"sourceFile": "pubmed/article.js"
Expand Down Expand Up @@ -20732,6 +20747,194 @@
"modulePath": "pubmed/citations.js",
"sourceFile": "pubmed/citations.js"
},
{
"site": "pubmed",
"name": "clinical-trial",
"description": "Search PubMed clinical trials with a trial-study preset",
"access": "read",
"domain": "pubmed.ncbi.nlm.nih.gov",
"strategy": "public",
"browser": false,
"args": [
{
"name": "query",
"type": "str",
"required": true,
"positional": true,
"help": "Clinical topic query, e.g. \"breast cancer\""
},
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Max results (1-100)"
},
{
"name": "year-from",
"type": "int",
"required": false,
"help": "Filter publication year from"
},
{
"name": "year-to",
"type": "int",
"required": false,
"help": "Filter publication year to"
},
{
"name": "free-full-text",
"type": "boolean",
"default": false,
"required": false,
"help": "Only include free full text articles"
},
{
"name": "sort",
"type": "str",
"default": "date",
"required": false,
"help": "Sort by date or relevance",
"choices": [
"date",
"relevance"
]
}
],
"columns": [
"rank",
"pmid",
"title",
"authors",
"journal",
"year",
"article_type",
"doi",
"url"
],
"type": "js",
"modulePath": "pubmed/clinical-trial.js",
"sourceFile": "pubmed/clinical-trial.js"
},
{
"site": "pubmed",
"name": "journal",
"description": "Search PubMed articles by journal name",
"access": "read",
"domain": "pubmed.ncbi.nlm.nih.gov",
"strategy": "public",
"browser": false,
"args": [
{
"name": "journal",
"type": "str",
"required": true,
"positional": true,
"help": "Journal name, e.g. \"Nature\" or \"The Lancet\""
},
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Max results (1-100)"
},
{
"name": "year-from",
"type": "int",
"required": false,
"help": "Filter publication year from"
},
{
"name": "year-to",
"type": "int",
"required": false,
"help": "Filter publication year to"
},
{
"name": "sort",
"type": "str",
"default": "relevance",
"required": false,
"help": "Sort by relevance or date",
"choices": [
"relevance",
"date"
]
}
],
"columns": [
"rank",
"pmid",
"title",
"authors",
"journal",
"year",
"article_type",
"doi",
"url"
],
"type": "js",
"modulePath": "pubmed/journal.js",
"sourceFile": "pubmed/journal.js"
},
{
"site": "pubmed",
"name": "mesh",
"description": "Search PubMed articles by MeSH term",
"access": "read",
"domain": "pubmed.ncbi.nlm.nih.gov",
"strategy": "public",
"browser": false,
"args": [
{
"name": "term",
"type": "str",
"required": true,
"positional": true,
"help": "MeSH term, e.g. \"Neoplasms\" or \"Machine Learning\""
},
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Max results (1-100)"
},
{
"name": "major",
"type": "boolean",
"default": false,
"required": false,
"help": "Only include articles where this is a major MeSH topic"
},
{
"name": "sort",
"type": "str",
"default": "relevance",
"required": false,
"help": "Sort by relevance or date",
"choices": [
"relevance",
"date"
]
}
],
"columns": [
"rank",
"pmid",
"title",
"authors",
"journal",
"year",
"article_type",
"doi",
"url"
],
"type": "js",
"modulePath": "pubmed/mesh.js",
"sourceFile": "pubmed/mesh.js"
},
{
"site": "pubmed",
"name": "related",
Expand Down Expand Up @@ -20779,6 +20982,75 @@
"modulePath": "pubmed/related.js",
"sourceFile": "pubmed/related.js"
},
{
"site": "pubmed",
"name": "review",
"description": "Search PubMed review articles with a review preset",
"access": "read",
"domain": "pubmed.ncbi.nlm.nih.gov",
"strategy": "public",
"browser": false,
"args": [
{
"name": "query",
"type": "str",
"required": true,
"positional": true,
"help": "Review topic query, e.g. \"immunotherapy\""
},
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Max results (1-100)"
},
{
"name": "year-from",
"type": "int",
"required": false,
"help": "Filter publication year from"
},
{
"name": "year-to",
"type": "int",
"required": false,
"help": "Filter publication year to"
},
{
"name": "has-abstract",
"type": "boolean",
"default": false,
"required": false,
"help": "Only include articles with abstracts"
},
{
"name": "sort",
"type": "str",
"default": "date",
"required": false,
"help": "Sort by date or relevance",
"choices": [
"date",
"relevance"
]
}
],
"columns": [
"rank",
"pmid",
"title",
"authors",
"journal",
"year",
"article_type",
"doi",
"url"
],
"type": "js",
"modulePath": "pubmed/review.js",
"sourceFile": "pubmed/review.js"
},
{
"site": "pubmed",
"name": "search",
Expand Down
35 changes: 20 additions & 15 deletions clis/pubmed/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ cli({
domain: 'pubmed.ncbi.nlm.nih.gov',
strategy: Strategy.PUBLIC,
browser: false,
defaultFormat: 'plain',
args: [
{ name: 'pmid', positional: true, required: true, help: 'PubMed ID, e.g. 37780221' },
{ name: 'full-abstract', type: 'boolean', default: false, help: 'Do not truncate the abstract in table output' },
],
columns: ['field', 'value'],
columns: ['pmid', 'title', 'authors', 'journal', 'year', 'date', 'article_type', 'language', 'doi', 'pmc', 'affiliations', 'grants', 'mesh_terms', 'keywords', 'abstract', 'url'],
func: async (args) => {
const pmid = requirePmid(args.pmid);
const xml = await eutilsFetch('efetch', {
Expand All @@ -31,20 +32,24 @@ cli({
}
const abstract = args['full-abstract'] ? article.abstract : truncateText(article.abstract, 500);
return [
{ field: 'PMID', value: article.pmid },
{ field: 'Title', value: article.title },
{ field: 'Authors', value: article.authors.join(', ') },
{ field: 'Journal', value: article.journal },
{ field: 'Year', value: article.year },
{ field: 'Date', value: article.date },
{ field: 'Article Type', value: article.article_type },
{ field: 'Language', value: article.language },
{ field: 'DOI', value: article.doi || null },
{ field: 'PMC ID', value: article.pmc || null },
{ field: 'MeSH Terms', value: article.mesh_terms || null },
{ field: 'Keywords', value: article.keywords || null },
{ field: 'Abstract', value: abstract || null },
{ field: 'URL', value: article.url },
{
pmid: article.pmid,
title: article.title,
authors: article.authors.join(', '),
journal: article.journal,
year: article.year,
date: article.date || null,
article_type: article.article_type,
language: article.language || null,
doi: article.doi || null,
pmc: article.pmc || null,
affiliations: article.affiliations || null,
grants: article.grants || null,
mesh_terms: article.mesh_terms || null,
keywords: article.keywords || null,
abstract: abstract || null,
url: article.url,
},
];
},
});
Loading
Loading