Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better DOI term snippet, 3.7+ testing docs #29

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
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
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ When searching GWAS catalog PMID is needed over DOI. You can covert one to the o

```python
def doi_term(doi: str) -> str:
"""Prepare DOI for PubMed search"""
"""Clean a DOI string by removing URL prefix."""
doi = (
doi
.replace('http://', 'https://')
Expand All @@ -283,27 +283,31 @@ result = entrez_api.search(
database='pubmed',
max_results=1
)
result.data['esearchresult']['idlist']
try:
print(result.data['esearchresult']['idlist'])
except KeyError as exc:
raise ValueError(
f"Unexpected response data blob {result.data}."
) from exc
Copy link
Owner

@krassowski krassowski Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would skip error handling from the examples in the readme. They are meant to be illustrative, not comprehensive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks! Will implement that shortly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, done!

```

> `['33834021']`

### Installation

Requires Python 3.6+. Install with:

Requires Python 3.6+ (though only 3.7+ is tested). Install with:

```bash
pip install easy-entrez
```

If you wish to enable (optional, tqdm-based) progress bars use:
If you wish to enable (optional, `tqdm`-based) progress bars use:

```bash
pip install easy-entrez[with_progress_bars]
```

If you wish to enable (optional, pandas-based) parsing utilities use:
If you wish to enable (optional, `pandas`-based) parsing utilities use:

```bash
pip install easy-entrez[with_parsing_utils]
Expand Down
Loading