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.
To install brickftp, simply:
pip install brickftp
from brickftp import BrickFTP
client = BrickFTP(
username='bob@example.com',
password='password123',
subdomain='subdomain',
)
NOTE: For each client method, if there is a negative response from the API then BrickFTPError
will raise.
client.dir('/some_remote/path')
Upto 5MB supported by the client at this time.
client.upload(upload_path='/some/path.txt', local_path='path.txt')
client.download_file(remote_path='/some/path.txt', local_path='path.txt')
NOTE: Deletes recursively through subdirectories.
client.delete('/some_remote/path')
client.mkdir('/some_remote/path')
1. Python 3.6+ 2. See requirements.txt
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