Skip to main content

📊 CSV Citation Counter

This Python script processes one or more CSV files to summarize publication and citation data by a chosen column — such as journal names, author names, or institutions.

It supports:

  • ✅ Counting how many times each entry appears (e.g., number of articles per journal)
  • ✅ Summing citations per entry using a "Cited by" column
  • ✅ Calculating average and max citations per entry
  • ✅ Sorting results by:
    • Number of articles [articles]
    • Total citations [total]
    • Average citations per article [avg]
  • ✅ Handling multi-entry fields (e.g., multiple authors separated by ; )
  • ✅ Writing clean summaries to a human-readable summary.txt

📦 Requirements

No external libraries required — works with standard Python 3.


🚀 How to Run the Script

You can run the script in two ways:


✅ Option 1: Command Line Arguments

python script.py \
  --files data/file1.csv data/file2.csv \
  --column "Authors" \
  --split "; " \
  --sortby avg

✅ Option 2: Interactive Mode

You'll be prompted to:

Enter file paths or folders:

Input one path per line (CSV file or folder)

Hit Enter on an empty line when you're done

All .csv files in a folder will be included

Column name to analyze (e.g., Journal, Authors)

Delimiter (optional) if each csv entry has multiple elements (such as authors):

Leave blank for single-entry fields

Make sure to add a space (like "; ") if necessary.

Sort method (optional):

articles → by number of articles (default)

total → by total citations

avg → by average citations per article

Output

The summary is recorded to a summary.txt in the same directory where this script was run. Blank lines separated groups with differnet values for the sort attribute.

Metadata

Release files for csv-citation-counter 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csv-citation-counter 0.1.0
File Size Uploaded
csv_citation_counter-0.1.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for csv-citation-counter 0.1.0
File Interpreter ABI Platform
csv_citation_counter-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / csv_citation_counter-0.1.0.tar.gz

Download URL csv_citation_counter-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a18c9fe5f02e2754d20e1c2cfed4f604a11f57fb4fb80ce3a5726b9495a736a
BLAKE2b-256 checksum
How to use checksums
35df2822e890d77cce72cbe983add244fc875822f8d1ff5d271ff65b67ec0ea3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / csv_citation_counter-0.1.0-py3-none-any.whl

Download URL csv_citation_counter-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3d794f3e5eb027ebc1577441744951a9da15ba731b0dab025f4203c250829b3
BLAKE2b-256 checksum
How to use checksums
b792994810de6b7e0108e1e52e5db547d7feaffabf5d937279e0e533200f61c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page