miarec_ftpfs
MiaRec FTPFS is a PyFilesystem interface to FTP/FTPS storage.
This a fork of the builtin FTPFS class from PyFileSystem2 project, written by Will McGugan (email willmcgugan@gmail.com).
The code was modified by MiaRec team to fullfill our needs.
Notable differences between miarec_ftpfs.FTPFS and fs.FTPFS
-
Requires Python 3.6+. A support of Python 2.7 is removed.
-
Opener protocol prefixes are
mftp://andmftps://for FTP and FTP-over-TLS respectively (instead of the originalftp://andftps://) -
Add Implicit TLS support
-
Fix bugs in Explicit TLS implementation
-
Automatically try to re-open FTP connection on the next operation in case of network issues. Previously, the
FTPFSobject was stuck in error state, and any operations on the file system instance, likeopenbin(),listdir(), etc, were failing infinitely. -
Better error handling. All FTP protocol-specific and SSL errors are converted into corresponding
FSErrorexception
Installing
You can install FTPFS from pip as follows:
pip install miarec_ftpfs
This will install the most recent stable version.
Alternatively, if you want the cutting edge code, you can check out the GitHub repos at https://github.com/miarec/miarec_ftpfs
Opening a FTPFS
Open an FTPFS by explicitly using the constructor:
from fs.ftpfs import FTPFS
FTPFS("demo.wftpserver.com")
Or via an FS URL:
ftp_fs = fs.open_fs('mftp://test.rebex.net')
Or via an FS URL, using TLS:
ftp_fs = fs.open_fs('mftps://demo.wftpserver.com')
You can also use a non-anonymous username, and optionally a password, even within a FS URL:
ftp_fs = FTPFS("test.rebex.net", user="demo", passwd="password")
ftp_fs = fs.open_fs('mftp://demo:password@test.rebex.net')
Connecting via a proxy is supported. If using a FS URL, the proxy URL will need to be added as a URL parameter:
ftp_fs = FTPFS("ftp.ebi.ac.uk", proxy="test.rebex.net")
ftp_fs = fs.open_fs('mftp://ftp.ebi.ac.uk/?proxy=test.rebex.net')
Testing
Automated unit tests are run on GitHub Actions
To run the tests locally, do the following.
Create activate python virtual environment:
python -m vevn venv
source venv\bin\activate
Install the project and test dependencies:
pip install -e ".[test]"
Run tests:
pytest
Documentation
Metadata
Release files for miarec-ftpfs 2025.5.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| miarec_ftpfs-2025.5.27.tar.gz | 24.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| miarec_ftpfs-2025.5.27-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 41.7 kB
Release files / miarec_ftpfs-2025.5.27.tar.gz
| Download URL | miarec_ftpfs-2025.5.27.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c72e0c8a7088f6c76b3a804e03d615a9598b15b93d30c9cff32e6100baba6db3
|
|
BLAKE2b-256 checksum How to use checksums |
885d5c999c66b4f1e4182d2de92a38d18432c4d191ab244ebd6228129cf00b34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / miarec_ftpfs-2025.5.27-py2.py3-none-any.whl
| Download URL | miarec_ftpfs-2025.5.27-py2.py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e6713e35ee0a42c3717f5bbe976c9dd7a3fc8c90f217bcabd8ccc13e9363e439
|
|
BLAKE2b-256 checksum How to use checksums |
e89616cc6c0e97c5d9d6eec2f50cea181f2d2fd959c31a79fe9142f456cc03c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|