Easily download files from ftp servers!
Installation
Install from PyPI using pip:
pip install ftp_download
Getting started:
ftp_download is built upon Python's ftplib, 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.
Metadata
Release files for ftp-download 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ftp_download-0.1.1.tar.gz | 10.3 kB | Without provenance | Details for ftp_download-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ftp_download-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for ftp_download-0.1.1-py3-none-any.whl |
Total release size: 19.1 kB
Release files / ftp_download-0.1.1.tar.gz
| Download URL | ftp_download-0.1.1.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c75d2a4c255ec48234240319c9f858add5e75a3fdec1a040fad5b2f71049047
|
|
BLAKE2b-256 checksum How to use checksums |
9364396ccb17c1284dfedf9d2d72ce4fa656e3c7eddd18945fc8da86fb182cb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / ftp_download-0.1.1-py3-none-any.whl
| Download URL | ftp_download-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe2d873d91b430f121b09cc084d6442506f460f754e23f25175d462b1dda00f0
|
|
BLAKE2b-256 checksum How to use checksums |
9424333392c984051862961efde990c32bc980b8d9b480fa3d23a1ede5643e9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for ftp-download 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.