A tool to connect to and interact with vendor servers via FTP/SFTP clients.
Install via pip:
python -m pip install git+https://github.com/BookOps-CAT/file-retrieverPython 3.9 and up.
0.2.0
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)0.2.0 - 2025-01-13
pyyamlandtypes-pyyamlto dev dependencies (previously they were project dependencies)- python 3.13 to unit tests
_ftpClient.get_file_dataand_ftpClient.list_file_dataso 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_permissionscan now calculate the decimal value of file permissions that are represented in either symbolic or octal notation- updated
types-paramiko