/BrickFTP

🐍 Python Client for BrickFTP API (https://developers.brickftp.com/)

Primary LanguagePythonOtherNOASSERTION

BrickFTP

PyPI Python Versions Build Status

Python Client for BrickFTP API (https://developers.brickftp.com/). This client does not implement all the features of the API, pull requests are very welcome to expand functionality.

Installation

To install brickftp, simply:

pip install brickftp

How To Use

Initialise the client

from brickftp import BrickFTP
client = BrickFTP(
    username='bob@example.com',
    password='password123',
    subdomain='subdomain',
)

Available methods

NOTE: For each client method, if there is a negative response from the API then BrickFTPError will raise.

List the contents of a folder

client.dir('/some_remote/path')

Upload a file

Upto 5MB supported by the client at this time.

client.upload(upload_path='/some/path.txt', local_path='path.txt')

Download a file

client.download_file(remote_path='/some/path.txt', local_path='path.txt')

Delete a file or folder

NOTE: Deletes recursively through subdirectories.

client.delete('/some_remote/path')

Create a folder

client.mkdir('/some_remote/path')

Requirements

1. Python 3.6+
2. See requirements.txt

Running the tests

Set the environment variables: BRICK_FTP_USER, BRICK_FTP_PASS, BRICK_FTP_SUBDOMAIN.

NOTE: Running the tests against a BrickFTP user will wipe all data on their account.

pip install -r requirements-test.txt
pytest