ftp-download


Nameftp-download JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryEasily download files from ftp servers!
upload_time2024-02-25 15:08:30
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT License Copyright (c) 2024 Vitor Ferreira Lins Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords download ftp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Project banner](docs/gh_banner.png)

Easily download files from ftp servers!

![Tests](https://github.com/VFLins/ftp_download/actions/workflows/tests.yml/badge.svg)
<a href="https://vflins.github.io/ftp_download/docs/ftp_download.html" ><img alt="Static Badge" src="https://img.shields.io/badge/documentation%20-%20vflins.github.io%20-%20blue?logo=github&color=blue">
</a>

# Installation

Install from PyPI using `pip`:

```
pip install ftp_download
```

# Getting started:

`ftp_download` is built upon Python's [`ftplib`](https://docs.python.org/3/library/ftplib.html), an it is a higher level interface made to allow downloads from ftp servers with simple and straightfoward code. 

Here, everything starts with creating an `ftplib.FTP` object:

```
from ftplib import FTP

ftp = FTP(
    host = "ftp.examplehost.com",
    user = "your_login_name",
    passwd = "your_secure_password",
    acct = "your_account_if_any"
)
```

Then you can start downloading. **Here are some examples:**

### Download a single file

For the examples here we will go with:

```
import ftp_download as ftpd
from ftplib import FTP
import os

ftp = FTP("cran.r-project.org")
```

To download a file we can do this:

```
# downloading /pub/R/CRANlogo.png 
# from cran.r-project.org

rp = "/pub/R/CRANlogo.png"
lp = os.path.expanduser("~") # Download to user folder

ftpd.file(ftp, remote_file_path=rp, local_path=lp)
```

Notice that `local_path` was specified, but if not, `ftp_download` will save the files in `{user_folder}/Downloads/ftp_download`.

### Download files from a folder

You can also give a path to a folder and download everything from there, notice that this is not recursive, and will get only the files at the top level of `remote_path`.

```
rp = "/pub/R/web"
lp = os.path.expanduser("~") # Download to user folder

ftpd.from_folder(ftp, remote_path=rp, local_path=lp)
```

It's also important to notice that currently, `ftp_download` will not create a "web" folder on the `local_path` specified.

### Important configurations

`ftp_download` will have a standard behavior that can be tweaked by changing the default values of `ftp_download.Conf`:

```
import ftp_download as ftpd

# To stop printing event messages to stdout (default: True)
ftpd.Conf.verbose = False

# To change the standard download path (default: {user_folder}/Downloads/ftp_download)
ftpd.Conf.download_folder = "C:\\my\\custom\\path"

# To change the maximum amount of concurrent downloads (default: 20)
ftpd.Conf.set_max_concurrent_jobs(300)
```

For more information, read the [documentation](https://vflins.github.io/ftp_download/docs/ftp_download/prefs.html).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ftp-download",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "download,ftp",
    "author": "",
    "author_email": "\"Vitor F. Lins\" <vflins@live.com>",
    "download_url": "https://files.pythonhosted.org/packages/93/64/396ccb17c1284dfedf9d2d72ce4fa656e3c7eddd18945fc8da86fb182cb3/ftp_download-0.1.1.tar.gz",
    "platform": null,
    "description": "![Project banner](docs/gh_banner.png)\n\nEasily download files from ftp servers!\n\n![Tests](https://github.com/VFLins/ftp_download/actions/workflows/tests.yml/badge.svg)\n<a href=\"https://vflins.github.io/ftp_download/docs/ftp_download.html\" ><img alt=\"Static Badge\" src=\"https://img.shields.io/badge/documentation%20-%20vflins.github.io%20-%20blue?logo=github&color=blue\">\n</a>\n\n# Installation\n\nInstall from PyPI using `pip`:\n\n```\npip install ftp_download\n```\n\n# Getting started:\n\n`ftp_download` is built upon Python's [`ftplib`](https://docs.python.org/3/library/ftplib.html), an it is a higher level interface made to allow downloads from ftp servers with simple and straightfoward code. \n\nHere, everything starts with creating an `ftplib.FTP` object:\n\n```\nfrom ftplib import FTP\n\nftp = FTP(\n    host = \"ftp.examplehost.com\",\n    user = \"your_login_name\",\n    passwd = \"your_secure_password\",\n    acct = \"your_account_if_any\"\n)\n```\n\nThen you can start downloading. **Here are some examples:**\n\n### Download a single file\n\nFor the examples here we will go with:\n\n```\nimport ftp_download as ftpd\nfrom ftplib import FTP\nimport os\n\nftp = FTP(\"cran.r-project.org\")\n```\n\nTo download a file we can do this:\n\n```\n# downloading /pub/R/CRANlogo.png \n# from cran.r-project.org\n\nrp = \"/pub/R/CRANlogo.png\"\nlp = os.path.expanduser(\"~\") # Download to user folder\n\nftpd.file(ftp, remote_file_path=rp, local_path=lp)\n```\n\nNotice that `local_path` was specified, but if not, `ftp_download` will save the files in `{user_folder}/Downloads/ftp_download`.\n\n### Download files from a folder\n\nYou can also give a path to a folder and download everything from there, notice that this is not recursive, and will get only the files at the top level of `remote_path`.\n\n```\nrp = \"/pub/R/web\"\nlp = os.path.expanduser(\"~\") # Download to user folder\n\nftpd.from_folder(ftp, remote_path=rp, local_path=lp)\n```\n\nIt's also important to notice that currently, `ftp_download` will not create a \"web\" folder on the `local_path` specified.\n\n### Important configurations\n\n`ftp_download` will have a standard behavior that can be tweaked by changing the default values of `ftp_download.Conf`:\n\n```\nimport ftp_download as ftpd\n\n# To stop printing event messages to stdout (default: True)\nftpd.Conf.verbose = False\n\n# To change the standard download path (default: {user_folder}/Downloads/ftp_download)\nftpd.Conf.download_folder = \"C:\\\\my\\\\custom\\\\path\"\n\n# To change the maximum amount of concurrent downloads (default: 20)\nftpd.Conf.set_max_concurrent_jobs(300)\n```\n\nFor more information, read the [documentation](https://vflins.github.io/ftp_download/docs/ftp_download/prefs.html).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Vitor Ferreira Lins  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Easily download files from ftp servers!",
    "version": "0.1.1",
    "project_urls": {
        "Documentation": "https://vflins.github.io/ftp_download/docs/ftp_download.html",
        "Repository": "https://github.com/VFLins/ftp_download"
    },
    "split_keywords": [
        "download",
        "ftp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9424333392c984051862961efde990c32bc980b8d9b480fa3d23a1ede5643e9a",
                "md5": "62f25891404182b263bf7fcb8b94431e",
                "sha256": "fe2d873d91b430f121b09cc084d6442506f460f754e23f25175d462b1dda00f0"
            },
            "downloads": -1,
            "filename": "ftp_download-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "62f25891404182b263bf7fcb8b94431e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8796,
            "upload_time": "2024-02-25T15:08:27",
            "upload_time_iso_8601": "2024-02-25T15:08:27.596765Z",
            "url": "https://files.pythonhosted.org/packages/94/24/333392c984051862961efde990c32bc980b8d9b480fa3d23a1ede5643e9a/ftp_download-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9364396ccb17c1284dfedf9d2d72ce4fa656e3c7eddd18945fc8da86fb182cb3",
                "md5": "ae81ea5d4572c82b6473512e3baa0098",
                "sha256": "0c75d2a4c255ec48234240319c9f858add5e75a3fdec1a040fad5b2f71049047"
            },
            "downloads": -1,
            "filename": "ftp_download-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ae81ea5d4572c82b6473512e3baa0098",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10302,
            "upload_time": "2024-02-25T15:08:30",
            "upload_time_iso_8601": "2024-02-25T15:08:30.008147Z",
            "url": "https://files.pythonhosted.org/packages/93/64/396ccb17c1284dfedf9d2d72ce4fa656e3c7eddd18945fc8da86fb182cb3/ftp_download-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-25 15:08:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "VFLins",
    "github_project": "ftp_download",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "ftp-download"
}
        
Elapsed time: 0.26904s