arxiva/README.md

1.1 KiB

Arxiva - arXiv Paper Fetcher Library

Arxiva is a Go library for fetching and saving research papers from arXiv.org.

Features

  • Fetch papers by date range and search query
  • Save results as JSON files
  • Automatic filename sanitization

Installation

Add the package to your project:

go get gitea.r8z.us/stwhite/arxiva

Usage

Import the package in your Go code:

import "gitea.r8z.us/stwhite/arxiva"

Example usage:

package main

import (
	"log"
	"gitea.r8z.us/stwhite/arxiva"
)

func main() {
	// Fetch papers
	papers, err := arxiva.FetchPapers("20240101", "20240125", "quantum computing", 100)
	if err != nil {
		log.Fatal(err)
	}

	// Save to file
	err = arxiva.SaveToFile(papers, "20240101", "20240125", "quantum computing")
	if err != nil {
		log.Fatal(err)
	}
}

API Reference

FetchPapers(startDate, endDate, query string, maxResults int) ([]Paper, error)

Fetches papers from arXiv API

SaveToFile(papers []Paper, startDate, endDate, query string) error

Saves papers to a JSON file

Dependencies

  • Standard Go libraries
  • arXiv API (no API key required)

License

MIT License