pyEuropePMC

Analytics skill

Summarise and plot Europe PMC search results with the analytics and visualization functions. The full reference is Analytics and visualization.

from pyeuropepmc import (
    SearchClient,
    citation_statistics,
    plot_citation_distribution,
    publication_year_distribution,
    to_dataframe,
)

with SearchClient() as client:
    response = client.search("cancer", pageSize=100)

papers = response["resultList"]["result"]
papers_df = to_dataframe(papers)

stats = citation_statistics(papers_df)
print(f"Mean citations: {stats['mean_citations']:.2f}")
print(f"Max citations: {stats['max_citations']}")

print(publication_year_distribution(papers_df))

fig = plot_citation_distribution(papers_df, save_path="citations.png")

Key tips: