paper-system/README.md

67 lines
1.1 KiB
Markdown
Raw Normal View History

2025-01-25 17:07:24 +00:00
# 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:
```bash
go get gitea.r8z.us/stwhite/arxiva
```
## Usage
Import the package in your Go code:
```go
import "gitea.r8z.us/stwhite/arxiva"
```
Example usage:
```go
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