Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install gocept.sftpcopy

How to install gocept.sftpcopy

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install gocept.sftpcopy
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
Windows (64-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
Mac OS X (10.5+)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
Linux (32-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
Linux (64-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
 
License
ZPL 2.1
Lastest release
version 0.2.2 on May 23rd, 2012

sftpcopy allows to copy files to or from a remote server -- integrates with gocept.filestore. sftpcopy will take files from the new directory, copy them to the remote server and put them into cur on success. Likewise it will download files from the remote server and put them into the new directory for another application to pick it up.

Usage

You can either give the name of a configuration file on the commandline, or pass the configuration values as a dict directly to the entrypoint (useful for buildout integration). The configuration file has the following format:

[general]
mode = upload # or download
logfile = /path/to/logfile # defaults to stdout if not given

[local]
path = /path/on/local/machine

[remote]
path = /path/on/remote/machine
hostname = remote.host
port = 22
username = user
password = secret

The configdict uses the following keys instead:

  • logfile
  • local_path
  • remote_path
  • hostname
  • port
  • username
  • password

You can also use sftpcopy as a python object like this:

import gocept.sftpcopy
sftp = gocept.sftpcopy.SFTPCopy(
    'download', '/path/on/local/machine',
    'remote.host', 22, 'user', 'secret', '/path/on/remote/machine')
sftp.connect()
sftp.uploadNewFiles() # or sftp.downloadNewFiles()

AMQP integration

If you require the amqp extra, gocept.sftpcopy offers a gocept.amqprun queue handler that uploads the message body as a file via SFTP (it respects the X-Filename header or generates a filename based on routing key and a timestamp). Here's an example ZCML snippet:

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:amqp="http://namespaces.gocept.com/amqp">

  <include package="gocept.amqprun" />
  <include package="gocept.sftpcopy" file="meta.zcml" />

  <amqp:sftpupload
    routing_key="test.data"
    queue_name="test.queue"
    hostname="remote.host"
    port="22"
    username="user"
    password="secret"
    remote_path="/path/on/remote/machine"
    arguments="
    x-ha-policy = all
    "
    />

</configure>

Changelog

0.2.2 (2012-04-04)

  • Update to gocept.amqprun-0.8.

0.2.1 (2012-03-29)

  • Make amqp server configurable for tests.
  • Clean up garbage connections left by tests (#10634).

0.2 (2012-02-22)

  • Add gocept.amqprun integration.

0.1.4 (2009-11-16)

  • Log errors that occur while connecting

0.1.3 (2008-02-27)

  • Added configdict argument to main function for easier buildout integration.

0.1.2 (2008-02-18)

  • Fixed bug in connection logging.
  • Remember filestore so we can actually upload/download.
  • Did some testing predefined user.

0.1.1 (2007-11-13)

  • Fixed brown back release 0.1 which was not usable at all since there were various files missing in the archive.

Subscribe to package updates

Last updated May 23rd, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.