Skip to main content

A package for processing academic references from plaintext files

Project description

RefCatch

A Python package for processing academic references from plaintext files. RefCatch extracts references from text files (markdown, txt, etc.), attempts to find their DOIs using the CrossRef API, and outputs the results.

Installation

pip install refcatch

Or install directly from the repository:

git clone https://github.com/AhsanKhodami/refcatch.git
cd refcatch
pip install -e .

Publishing to PyPI

To publish RefCatch to PyPI:

# Install build and twine
pip install build twine

# Build the package
python -m build

# Upload to PyPI (use --repository-url https://test.pypi.org/legacy/ for TestPyPI)
python -m twine upload dist/*

Usage

As a Python Package

from refcatch import refcatch

# Basic usage
refcatch("path/to/references.md", "path/to/output.md")

# With all options
refcatch(
    input_file="path/to/references.md", 
    output_file="path/to/output.md",
    doi_file="path/to/dois.txt",  # Optional, will be auto-generated if not provided
    log=True  # Set to False to disable logging
)

Command Line Interface

# Basic usage
refcatch references.md

# Specify output file
refcatch references.md -o output.md

# Specify DOI file and run silently
refcatch references.md -o output.md -d dois.txt --silent

Example

Input file (references.md):

1.	Wong WL, Su X, Li X, et al. Global prevalence of age-related macular degeneration and disease burden projection for 2020 and 2040: a systematic review and meta-analysis. Lancet Glob Health. 2014;2(2):e106-116.
2.	Flaxman SR, Bourne RRA, Resnikoff S, et al. Global causes of blindness and distance vision impairment 1990-2020: a systematic review and meta-analysis. Lancet Glob Health. 2017;5(12):e1221-e1234.

Output file:

1.	Wong WL, Su X, Li X, et al. Global prevalence of age-related macular degeneration and disease burden projection for 2020 and 2040: a systematic review and meta-analysis. Lancet Glob Health. 2014;2(2):e106-116.
    DOI: 10.1016/S2214-109X(13)70145-1
2.	Flaxman SR, Bourne RRA, Resnikoff S, et al. Global causes of blindness and distance vision impairment 1990-2020: a systematic review and meta-analysis. Lancet Glob Health. 2017;5(12):e1221-e1234.
    DOI: 10.1016/S2214-109X(17)30393-5

Features

  • Extracts references from plaintext files
  • Makes multiple attempts to find DOIs with different search strategies
  • Outputs references with their DOIs
  • Saves DOIs to a separate file
  • Optional logging of the process
  • Simple command-line interface

License

MIT

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

refcatch-0.1.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

refcatch-0.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file refcatch-0.1.1.tar.gz.

File metadata

  • Download URL: refcatch-0.1.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.13

File hashes

Hashes for refcatch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b26351cc4c377aaa3f06da97f9c8243534b83160db4b9fc8ca93ac5108fbf622
MD5 8bf8e2c817f1a5a7cd189702fa2a04cc
BLAKE2b-256 1daef69299d00adab4880c1ffdd19d9eb054f3d20ba16922ea2b47bc3a1b50e3

See more details on using hashes here.

File details

Details for the file refcatch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: refcatch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.13

File hashes

Hashes for refcatch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 150410a758bacea87400fafd3e9d7b34f7048f98ca74422099771016d9ca027b
MD5 453b71d4576375b7a7cbaa8a482d7037
BLAKE2b-256 04841dc5e39ee9a2aefff48d98b022fdb49452eced1e54d8c2f2446a970adeaf

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