Skip to content

BookOps-CAT/file-retriever

Repository files navigation

tests Coverage Status Code style: black License: MIT

File Retriever

A tool to connect to and interact with vendor servers via FTP/SFTP clients.

Installation

Install via pip:

python -m pip install git+https://github.com/BookOps-CAT/file-retriever

Python 3.9 and up.

Version

0.2.0

Usage

from file_retriever import Client

vendor_client = Client(
        name=vendor_name,
        username=user,
        password=password,
        host=host,
        port=port,
    )
with vendor_client as client:
    file_data = client.get_file_info(file_name="test.mrc", remote_dir="test_dir")
    file = client.get_file(file=file_data, remote_dir="test_dir")
    client.put_file(file=file, dir="local_dir", remote=False, check=True)

Changelog

0.2.0 - 2025-01-13

Added

  • pyyaml and types-pyyaml to dev dependencies (previously they were project dependencies)
  • python 3.13 to unit tests

Changed

  • _ftpClient.get_file_data and _ftpClient.list_file_data so that it first attempts a MLSD command to retrieve file data from the server. An MLSD command retrieves file metadata for an entire directory with one command but FTP servers are not always configured to allow for it. The Backstage FTP server allows for this command and other commands (such as SIZE) are not allowed for zip files such as those that we retrieve from backstage.
  • File.__parse_permissions can now calculate the decimal value of file permissions that are represented in either symbolic or octal notation
  • updated types-paramiko

About

BookOps file retriever for FTP/SFTP servers

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages