Skip to main content

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')

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.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

BrickFTP-0.1.1-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file BrickFTP-0.1.1.tar.gz.

File metadata

  • Download URL: BrickFTP-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for BrickFTP-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eaea7ef69ae6d473aa799bdc62e8287ad602470d639e751ac230bfaf9279f6fe
MD5 88574a260bf82bdc0216de54d66db14e
BLAKE2b-256 9fbdddff7add83cdce3135e8573c1e2f03decacc59b9c5d15eed1f62bc2468f8

See more details on using hashes here.

File details

Details for the file BrickFTP-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for BrickFTP-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f362d08183ae07933311d7967f8263ee2f8e950c2ceef1474aecac0fc6e7ca1c
MD5 6b141cf634a84f68441321d1b8705bd7
BLAKE2b-256 17ecc8eb816321af1286f498adef88b1e4dafd2e9b6612161fee4aaac5699f0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page