Skip to main content

Pytroll file utilities

Project description

Trollmoves

Trollmoves is a package providing software for file transfers.

The common nominator is the use of Posttroll messaging to make requests, and to publish the completed transfers. These messages can be used to trigger further processing.

The required libraries are listed for each of the parts below.

Server/Client

Setup where one or more Server processes announce new files, and one or two Client processes make transfer requests for the configured files.

Trollmoves Server

Trollmoves Server is a process that follows a directory for new files, and publishes a message when a matching file appears. If a Client makes a request for a file, the file is transferred using one of the built-in movers (see below) based on the destination given in the request.

Required libraries:

  • netifaces
  • posttroll
  • pyzmq
  • trollsift
  • watchdog

In addition, the required packages for the transfer protocol(s) to be used need to be installed. See the mover documentation below for more details.

Running the server without a client

In some situations, it might be difficult to use the server/client architecture, and thus there is a possibility to run the server in stand alone mode. To do this, the only thing to do is omit the request_port configuration item in the server configuration. From that point on, the server will send full uris in the messages it publishes, along with a json representation of a fsspec filesystem. From there, processes accepting these (eg trollflow2) will be able to use fsspec to read and process the remote files.

Trollmoves Client

Trollmoves Client is configured to subscribe to a specific topic, and to make requests for matching files published by a Server. The destination of the file is given in the request message. The Server handles the actual transfer.

Client can be configured to listen to multiple sources for the same files. The request is made to the Server where the first announcement were received from.

Two clients can be configured to handle requests for a given data. This makes it possible to make updates without outages, and in general add redundancy. One of the Client processes is considered the primary, and the secondary will process the leftover messages after a small (for example 0.2 s - 1 s) delay. The Clients communicate which files are already handled, so duplicate transfers should not happen.

Required libraries:

  • netifaces
  • posttroll
  • pyzmq
  • trollsift

Trollmoves Mirror

Trollmoves Mirror is a setup of back-to-back Server and Client that is used for example to handle transfers from internal network to external Client processes. The Mirror receives announcements from the internal network, publishes the file on external network, and upon receiving a request handles the transfer from internal Server to temporary directory and further on to the external destination.

Required libraries:

  • netifaces
  • posttroll
  • pyzmq
  • trollsift
  • watchdog

In addition, the required packages for the transfer protocol(s) to be used. See the mover documentation below for more details.

Trollmoves Dispatcher

Trollmoves Dispatcher can push files from local file system to any destination supported by the built-in movers. The dispatching is triggered by Posttroll messages published by a process creating the files, or otherwise following the arrival/creation of files.

Required libraries:

  • netifaces
  • posttroll
  • pyinotify
  • pyzmq
  • trollsift

In addition, the required packages for the transfer protocol(s) to be used. See the mover documentation below for more details.

Individual movers

The individual movers can be used via the above listed processes, or used directly in other applications. The movers can be imported from the trollmoves.movers module.

FileMover

FileMover copies or moves a file between local filesystems.

Additional required packages: none.

FtpMover

FtpMover transfers a local file to a FTP server.

Additional required packages: none.

ScpMover

ScpMover uses SSH to transfer a local file to another (or the same) server.

Additional required packages:

  • scp
  • paramiko

SftpMover

SftpMover uses SFTP protocol to transfer a local file to an SFTP server.

Additional required packages:

  • paramiko

S3Mover

S3Mover uploads a file to an S3 object storage.

Additional required packages:

  • s3fs

Special behaviour on destination filepath when using the S3Mover class:

If the destination prefix (~filepath) has a trailing slash ('/') the original filename will be appended (analogous to moving a file from one directory to another keeping the same filename).

If the destination prefix does not have a trailing slash the operation will be analogous to moving a file from one directory to a new destination changing the filename. The new destination filename will be the last part of the provided destination following the last slash ('/').

s3downloader

This module is able to download files from a s3 endpoint.

The s3downloader module need to get posttroll messages from eg. s3stalker from the pytroll-collectors module which announces new available files in a configured s3 bucket. The s3downloader then downloads these files.

Example config for the module is given in examples/s3downloader-config.yaml. If you use a nameserver with muliticast (nameserver default) you don't need to include the nameserver option nor the service name in the config. Opposite if you use nameserver without multicast.

Additional required packages:

  • boto3
  • botocore

License

Copyright 2012 Trollmoves developers

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trollmoves-0.18.0.tar.gz (93.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trollmoves-0.18.0-py2.py3-none-any.whl (115.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file trollmoves-0.18.0.tar.gz.

File metadata

  • Download URL: trollmoves-0.18.0.tar.gz
  • Upload date:
  • Size: 93.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trollmoves-0.18.0.tar.gz
Algorithm Hash digest
SHA256 4ca17e5fdfce7b01c72aef633c0ccbfd790e5893771841df1ac2135f90778755
MD5 4f781bd4296f3f14a3aa482eec0705ae
BLAKE2b-256 ccf28282248937d177d90d657c85245df306025031a9290ded36bcf5fac668dc

See more details on using hashes here.

File details

Details for the file trollmoves-0.18.0-py2.py3-none-any.whl.

File metadata

  • Download URL: trollmoves-0.18.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 115.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trollmoves-0.18.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 669fe14eb81c6911b3a8057509ed398b1033a645ecb1bb887ceba3cc691a0f9b
MD5 cbb88c58d800ffaaab2dffaaaaef2694
BLAKE2b-256 c715403703f43f4d1458ce2dcd573985537d0fe57b697d05300fd1df3eedbcf1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page