Skip to content

zadarmo/server-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages