Giter Site home page Giter Site logo

arxiv_pdf_renamer's Introduction

ArXiv PDF Renamer

image

Goal

Our goal was to rename PDF files stored in the ~/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents/ directory. Each file was named with its unique arXiv ID, but we aimed to rename each file using its corresponding arXiv paper title for straightforward identification.

Approach

  1. We developed a Python function rename_pdfs(), which:
    • Parses a list of file paths.
    • Retrieves the arXiv IDs from the names of the files.
    • Sends a HTTP request to the arXiv API to get the title of the paper associated with each arXiv ID.
    • Renames each file with its paper title within the same directory.
  2. We introduced checks and error-handling to ensure smooth execution even when a file doesnt exist, the arXiv title is unavailable, or renaming fails.

ArXiv Title Retrieval

We accomplished this by sending an HTTP GET request to root_url + id_list= + arxiv_id. The root_url was the arXiv API URL, and our arXiv ID was appended to it. The request response held the metadata for the respective paper, which included the paper title. We extracted this title for renaming our PDF files.

Outcome

We passed all our PDF files within the ~/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents/ directory to rename_pdfs(). Among these files, we successfully renamed those with a valid arXiv ID, and ignored those with no valid arXiv ID or whose arXiv ID didnt have an associated title.

Our approach enables automatic and consistent naming of files, making it highly adaptable for similar future tasks.

arxiv_pdf_renamer's People

Contributors

andrewyu0 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.