A package to download project data files from FTP
Project description
FTP Data Loader
ftp-loader is a tool to download from and upload data files to FTP server. It is intended to use in projects with large data files. Data files are bad candidates for version control managment systems. They are better to be placed at FTP server and be downloaded on demand.
The suggested workflow is the following. Data files are placed in folders added to gitignore. ftp-config.toml file is used to maintain list of data files and their locations both at project folder and FTP. This is default name, but other *.toml files can be used to split file index into separate parts. Files can be compressed.
Installation
pip install ftp-loader
Usage
ftp-loader -h
Shows help.
ftp-loader [--overwrite] [ftp-config.toml]
Downloads and extracts data from FTP server. Index file name is optional. Default index file - ftp-config.toml.
ftp-loader --upload [--overwrite] [ftp-config.toml]
Compresses and uploads data to FTP server. Index file name is optional. Default index file - ftp-config.toml.
--overwrite Option instructs to overwrite existing files.
--check FTP_URL Checks user's initial path at ftp server.
--base-path BASE_PATH Specifies initial path at ftp.
Configuration
When user logs in its path can be different from the path to FTP root. In this case path to FTP's root must be specified. This can be done in two ways.
-
By specifying --base-path parameter in command line.
-
By setting base path in the configuration file. The configuration file must have name
.ftp-loader-config.jsonlocated at the user's home directory. It must contain "hosts" key with a dictionary of hosts and corresponding paths. For example: { "hosts": { "server.ftp.ru": "/home/path1" } }
Index file format
Index file must contain the following parameters:
-
FTP server URL.
url = "server.ftp.ru" -
Path to project's folder at FTP. For now only Unix-style is supported.
path = "/projects/test-data" -
List of files to be transferred. It is a list of file groups. Each group contain 3 or 4 parameters:
[[files]] dst = "work" # Destination folder name. src = "storage" # Source folder name relative to 'path'. arch = "bz2" # Optional. Archive type. Supported archive formats: # gz, bz2 names = [ # list of file names. file1.txt, file2.csv ]Every group of files starts with
[[files]]header. The number of groups is arbitrary.
Example of index file can be found in tests folder - ftp-config.toml.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ftp-loader-0.2.2.tar.gz.
File metadata
- Download URL: ftp-loader-0.2.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d62aabf0450cf93e8a99af1fe812ac9902b8cb76b82bdb234e9cc27e8fc0da4
|
|
| MD5 |
a303454bc877a4bb2cf3c9123ea86f93
|
|
| BLAKE2b-256 |
e624ef9bd0d079bf79bb98ddeb2a87d9f5553e9aaa7892a4adadb42d2e571681
|
File details
Details for the file ftp_loader-0.2.2-py3-none-any.whl.
File metadata
- Download URL: ftp_loader-0.2.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbccab10f0f15dda667a2578441ac5ae6e37b44da39d3256b5b7b00a05da5bc6
|
|
| MD5 |
0ff11d1a6fae7cbee3484273cf8aa2c6
|
|
| BLAKE2b-256 |
890996ff1db39db9ebfbdd02d1b5b2a428e4358e0a6618e1ff18ff7ec335373b
|