Skip to main content

A simple tool for developers that can perform operations on server with just a few line of codes.

Project description

server_connector

A simple tool for developers to perform operations on server with just a few line of codes.

install

pip i server_connector

Usage

Before you perform operations on server, you need to initialize a ServerConnector object:

from server_connector import server
server_info = {
    "ip": "your server ip",
    "username": "xxx",
    "password": "xxx"
}
sc = server.ServerConnector(server_info)

File operations

uploadFile(localPath, remotePath)

Upload a file from client to server.

sc.uploadFile("./xxx.txt", "/<directory>/xxx.txt")

Directory will be created recursively if it does not exist on server.

downloadFile(remotePath, localPath)

Download a file from server to client.

sc.downloadFile("/<directory>/xxx.txt", "./xxx.txt")

deleteFile(remotePath)

Delete a file from server.

sc.downloadFile("/path/to/your/file")

Directory operations

uploadDir(localPath, remotePath)

Upload a directory from client to server.

sc.uploadDir("./xxx", "/<directory>")

The xxx directory will be uploaded to /<directory>/xxx on server.

downloadDir(remotePath, localPath)

Download a directory from server to client.

sc.downloadDir("/<directory>/xxx", "./")

deleteDir(remotePath)

Delete a directory from server.

sc.deleteDir("/path/to/your/directory")

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

server_connector-0.0.1-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

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