topftp


Nametopftp JSON
Version 2024.3.13 PyPI version JSON
download
home_page
Summarya package on top of ftplib to use FTP easily
upload_time2024-03-13 11:45:34
maintainer
docs_urlNone
author
requires_python>=3.6
licenseBSD 3-Clause License Copyright (c) 2023, Lix Xu Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords ftp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # topftp

a package on top of ftplib to use FTP easily

## installation

```bash
pip install topftp
```

## usage

```python
from topftp.ftp import FTP

host = "127.0.0.1"
user ="username"
password = "password"
port = 21
timeout = 5

ftp = FTP(host, user, password, port=port, timeout=timeout)
# set verbose to True to print exceptions
# set silent to True to not raise exceptions
# ftp.silent = True
# ftp.verbose = True

ftp.connect()

# list files in current directory
files, folders = ftp.listdir()

# download file
ftp.download("/file.txt", "local_file.txt")

# download file content to list
lines = ftp.download_to_list("/file.txt")

# upload file
ftp.upload("local_file.txt", "/remote_file.txt")

# upload from string
ftp.upload_from_string("Hello, topftp!", "/remote_file.txt")

# delete file
ftp.delete("/remote_file.txt")

# for missing methods on ftplib.FTP, you can use them directly
# ftp.some_method(*args, **kwargs)
# is same to
# ftp.ftp.some_method(*args, **kwargs)

# close connection
ftp.close()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "topftp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "ftp",
    "author": "",
    "author_email": "Lix Xu <xuzenglin@gmail.com>",
    "download_url": "",
    "platform": null,
    "description": "# topftp\r\n\r\na package on top of ftplib to use FTP easily\r\n\r\n## installation\r\n\r\n```bash\r\npip install topftp\r\n```\r\n\r\n## usage\r\n\r\n```python\r\nfrom topftp.ftp import FTP\r\n\r\nhost = \"127.0.0.1\"\r\nuser =\"username\"\r\npassword = \"password\"\r\nport = 21\r\ntimeout = 5\r\n\r\nftp = FTP(host, user, password, port=port, timeout=timeout)\r\n# set verbose to True to print exceptions\r\n# set silent to True to not raise exceptions\r\n# ftp.silent = True\r\n# ftp.verbose = True\r\n\r\nftp.connect()\r\n\r\n# list files in current directory\r\nfiles, folders = ftp.listdir()\r\n\r\n# download file\r\nftp.download(\"/file.txt\", \"local_file.txt\")\r\n\r\n# download file content to list\r\nlines = ftp.download_to_list(\"/file.txt\")\r\n\r\n# upload file\r\nftp.upload(\"local_file.txt\", \"/remote_file.txt\")\r\n\r\n# upload from string\r\nftp.upload_from_string(\"Hello, topftp!\", \"/remote_file.txt\")\r\n\r\n# delete file\r\nftp.delete(\"/remote_file.txt\")\r\n\r\n# for missing methods on ftplib.FTP, you can use them directly\r\n# ftp.some_method(*args, **kwargs)\r\n# is same to\r\n# ftp.ftp.some_method(*args, **kwargs)\r\n\r\n# close connection\r\nftp.close()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2023, Lix Xu  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "a package on top of ftplib to use FTP easily",
    "version": "2024.3.13",
    "project_urls": {
        "Bug Tracker": "https://github.com/lixxu/topftp/issues",
        "Homepage": "https://github.com/lixxu/topftp"
    },
    "split_keywords": [
        "ftp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "defcc4ac6f445ef9902b4fc3319e8827375800de7aa009ae90cb986bd0cf6484",
                "md5": "63f8da9795c139fbddc60ef843883b5c",
                "sha256": "e3c6e87fa6f1877081a2b18b49d448c0c14f51ae9147ec10ccfddd8266660563"
            },
            "downloads": -1,
            "filename": "topftp-2024.3.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63f8da9795c139fbddc60ef843883b5c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5357,
            "upload_time": "2024-03-13T11:45:34",
            "upload_time_iso_8601": "2024-03-13T11:45:34.214084Z",
            "url": "https://files.pythonhosted.org/packages/de/fc/c4ac6f445ef9902b4fc3319e8827375800de7aa009ae90cb986bd0cf6484/topftp-2024.3.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 11:45:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lixxu",
    "github_project": "topftp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "topftp"
}
        
Elapsed time: 0.58108s