Python Client for BrickFTP API (https://developers.brickftp.com/).
Project description
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:
.. code:: bash
pip install brickftp
How To Use
----------
Initialise the client
~~~~~~~~~~~~~~~~~~~~~
.. code:: python
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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
client.dir('/some_remote/path')
Upload a file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Upto 5MB supported by the client at this time.
.. code:: python
client.upload(upload_path='/some/path.txt', local_path='path.txt')
Download a file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
client.download_file(remote_path='/some/path.txt', local_path='path.txt')
Delete a file or folder
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NOTE: Deletes recursively through subdirectories.
.. code:: python
client.delete('/some_remote/path')
Create a folder
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
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.
.. code:: bash
pip install -r requirements-test.txt
pytest
.. |PyPI| image:: https://img.shields.io/pypi/v/BrickFTP.svg
:target: https://pypi.python.org/pypi/BrickFTP
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/BrickFTP.svg
:target: https://pypi.python.org/pypi/BrickFTP
.. |Build Status| image:: https://travis-ci.org/Usio-Energy/BrickFTP.png?branch=master
:target: https://travis-ci.org/Usio-Energy/BrickFTP
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
BrickFTP-0.5.0.tar.gz
(7.3 kB
view details)
Built Distribution
File details
Details for the file BrickFTP-0.5.0.tar.gz
.
File metadata
- Download URL: BrickFTP-0.5.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc7647f97af22dd736b78e054d86b9944b5f9ed24aed0d3eed4d24bf0ccb04af |
|
MD5 | 4468219ea8e20d4bf46873304ce8a3cc |
|
BLAKE2b-256 | 802d5c66b490643a985ef40555b8d7925a1ee5c88c5f99e7dcda004138979380 |
File details
Details for the file BrickFTP-0.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: BrickFTP-0.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85d5d40b22491eda9683d314f17c200bee499fcdb6429dea73ac163db8cd3634 |
|
MD5 | fbbbf647b67045a4e8bf6c9de2d72731 |
|
BLAKE2b-256 | 1b7b44706d6fa5fb7459e938db6282f45e0e05dfd364186587233bec65a4732f |