https://github.com/octoenergy/brickftp
🐍 Python Client for BrickFTP API (https://developers.brickftp.com/)
https://github.com/octoenergy/brickftp
api-client api-wrapper brickftp file-hosting file-upload ftp python-library python3
Last synced: 7 months ago
JSON representation
🐍 Python Client for BrickFTP API (https://developers.brickftp.com/)
- Host: GitHub
- URL: https://github.com/octoenergy/brickftp
- Owner: octoenergy
- License: other
- Created: 2018-04-10T14:35:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-15T18:41:00.000Z (over 3 years ago)
- Last Synced: 2024-08-10T06:13:13.378Z (over 1 year ago)
- Topics: api-client, api-wrapper, brickftp, file-hosting, file-upload, ftp, python-library, python3
- Language: Python
- Size: 24.4 KB
- Stars: 0
- Watchers: 95
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
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