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/).
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')
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.1.0.tar.gz
(6.2 kB
view details)
Built Distribution
File details
Details for the file BrickFTP-0.1.0.tar.gz
.
File metadata
- Download URL: BrickFTP-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b302bb81fefd1f4f18ffe950ba1bacec6d949955490aff004a2d79cdd027d47 |
|
MD5 | 0fb6c1b2add508434078647313110819 |
|
BLAKE2b-256 | 4c60e0d72e3cbd97190f406ecf196897271641e3392c716ef1f8b30a1fc8495d |
File details
Details for the file BrickFTP-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: BrickFTP-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0698b62ec734ff7fd27da21d9d1b4b941181d6f72bdd6f2eb5297f71504267 |
|
MD5 | ab75a6565430d8bc405dc07fb2845402 |
|
BLAKE2b-256 | 7a29f21514031ee7234dd8ffcb3e2903fbbfc6c0d9bfce1e56a1dc55c6c8790b |