auto_research.utils.files module

select_pdf_file(folder_path)[source]

Present available PDF files to the user and handle file selection.

Parameters:

folder_path (str) – Path to the folder containing PDF files.

Returns:

A tuple containing the selected file name and its full path.

Return type:

Tuple[str, str]

Raises:

ValueError – If no PDF files are found in the folder or if the user input is invalid.

Example

>>> folder = "./sample_articles"
>>> filename, filepath = select_pdf_file(folder)
# This will display available PDFs and prompt for selection.
get_all_pdf_files(folder_path)[source]

Retrieve all PDF files in the specified folder.

Parameters:

folder_path (str) – Path to the folder containing PDF files.

Returns:

A list of full paths to the PDF files.

Return type:

list[str]

Raises:

ValueError – If no PDF files are found in the folder.

Example

>>> folder = "./sample_articles"
>>> pdf_files = get_all_pdf_files(folder)
# Returns a list of full paths to the PDFs.
print_summaries(storage_path='papers.json')[source]

Print summaries of papers from a JSON file.

Parameters:
  • storage_path (str) – Path to the JSON file containing paper summaries. Defaults to

  • "papers.json".

Return type:

None

Example

>>> print_summaries()
# This will print the summaries of all papers stored in the JSON file.