Skip to main content

Get publication metadata from NCBI's eUtils and generate citations.

Project description

Installation

pip install pub.tools

To use this tool you are advised to create an Entrez account and use the associated email and API key.

from Bio import Entrez
Entrez.email = "myemailhere@imsweb.com"
Entrez.tool = "pub.tools"
Entrez.api_key = "mykeyhere"

Tools available:

  • entrez - a wrapper API for BioPython
  • citations - creates citations for 6 different types using IMS standards
  • date - formats dates into our desired format

Citations

Citations are based on a standard defined by PubMed https://www.ncbi.nlm.nih.gov/books/NBK7256/. For some publication types, passing the italicize parameter with a True value will return HTML with italic tagged journals or conference names.

You can easily create a citation from a retrieved PubMed record:

>>> from pub.tools import entrez
>>> from pub.tools import citations
>>> if pub := entrez.get_publication(pmid=12345678):
>>>     citations.publication_citation(publication=pub)

Alternatively, you can pass one of the following to the citation function:

  1. An instance of one of the dataclasses in schema.py
  2. Keyword arguments directly

Journals

The journals module uses the PMC source file https://www.ncbi.nlm.nih.gov/pmc/journals/?format=csv to construct a library of journals keyed by abbreviation or full title.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pub.tools-5.3.0.tar.gz (337.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pub.tools-5.3.0-py3-none-any.whl (343.9 kB view details)

Uploaded Python 3

File details

Details for the file pub.tools-5.3.0.tar.gz.

File metadata

  • Download URL: pub.tools-5.3.0.tar.gz
  • Upload date:
  • Size: 337.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for pub.tools-5.3.0.tar.gz
Algorithm Hash digest
SHA256 de43c2903d5ade2eb96d4a93594b6fac3f9fb786cd6dde7a56dab81ec88d7513
MD5 79c674a6e761ef6fa77c79714d713a1f
BLAKE2b-256 ba21b7bebe14272d37a43f15fa30e2292f96f00726865f27fa09f874ed1a9af4

See more details on using hashes here.

File details

Details for the file pub.tools-5.3.0-py3-none-any.whl.

File metadata

  • Download URL: pub.tools-5.3.0-py3-none-any.whl
  • Upload date:
  • Size: 343.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for pub.tools-5.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d4e09b36032eb8ea432d15ed61ef0bd6a316f5778b363e558fd84ff79de9751
MD5 5dd5e148b8a389092b4804d7bbe06e2e
BLAKE2b-256 397d88af5bf7599fc21e2b5c2a78fe174626713dacfd314c4bda14a228eac3fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page