Coder Social home page Coder Social logo

pyftpclient's Introduction

PyFTPClient ๐Ÿš€

This Python script provides a simple FTP client that allows you to connect to a remote FTP server, perform various file and directory operations, and run local shell commands. The client provides a command-line interface and supports a range of FTP commands for interacting with the remote server.

Usage ๐Ÿ‘จโ€๐Ÿ’ป

To run the FTP client, execute the script using Python with the following command:

python3 PyFTPClient.py [IP] [port]
  • IP: The IP address of the remote FTP server.
  • port: (Optional) The port number to connect to the FTP server. The default port is 21.

Supported Commands โœ…

  • File Operations ๐Ÿ“‚:

    • ls: List files and directories on the remote FTP server.
    • cd: Change the current remote FTP directory.
    • pwd: Print the current remote FTP directory.
    • get: Download a file from the remote FTP server to the local machine.
    • put: Upload a local file to the remote FTP server.
    • rm: Remove a file from the remote FTP server.
    • mkdir: Create a directory on the remote FTP server.
    • rmdir: Remove a directory from the remote FTP server.
  • FTP Transfer ๐Ÿ“ก:

    • passive: Switch between passive and active mode for FTP transfers.
  • Permissions ๐Ÿ”’:

    • chmod: Change permission of a file on the remote FTP server.
  • Renaming ๐Ÿ”ง:

    • rename: Rename a file or directory on the remote FTP server.
  • File Size ๐Ÿ“:

    • size: Retrieve the size of a file on the remote FTP server.
  • Server Information โ„น๏ธ:

    • status: Get the status of the FTP server.
  • File Display ๐Ÿ“„:

    • open: Open and display the contents of a remote file.
  • Other Commands ๐Ÿ› ๏ธ:

    • history: Display the command history.
    • local: Run a local shell command and print the output.
    • whoami: Print the username of the currently logged-in user.
    • source: Change the directory shown in the prompt (local or remote).
    • help: Print a help message.

To see a list of all the suported commands a descriptiond and a usage help, use the following command:

python3 PyFTPClient.py -h

Other Features: ๐ŸŒŸ

  • Tab-completion: The client supports tab-completion for commands and file/directory paths.
  • Command History: The client keeps track of previously executed commands and allows you to access them using the up and down arrow keys.

Updates: ๐Ÿ†•

  • Source command added, now is possible to display local cwd or remote cwd
([email protected])-[~]: source 
([email protected])-[~/projects/PyFTPClient]: 
  • Progress bar added when download and upload files, also with file size and upload speed mesurements.
([email protected])-[~/projects/PyFTPClient]: put PyFTPClient.py
[==================================================] 100.00%  of 0.02 MB  [4.92 MB/s]         
File 'PyFTPClient.py' uploaded to '/home/server' in 0.01 seconds
  • Ability to enter passive and active mode
([email protected])-[~]: passive?
Passive mode is enabled
([email protected])-[~]: passive
Passive mode disabled
  • New commands
    - chmod
    - rename
    - size
    - status

Future Features

  • Ability to stop downloads and uploads without restarting
  • Tab update when working with directories

Dependencies ๐Ÿ› ๏ธ

This FTP client requires Python 3. The following libraries are used for various functionalities and are installed by default along with Python 3:

  • os
  • sys
  • time
  • ftplib
  • getpass
  • readline

No additional installation is required for these libraries.

Author โœ๏ธ

This FTP client is developed by OBoladeras and available on GitHub.

License ๐Ÿ“„

This FTP client is released under the MIT License. Feel free to use and modify it as per your needs.

Note ๐Ÿ“

This FTP client is a basic implementation and may not cover all use cases or handle errors extensively. Use it at your discretion and ensure proper permissions and access rights for remote FTP operations.

pyftpclient's People

Contributors

oboladeras avatar

Stargazers

Waseef avatar  avatar

Watchers

 avatar

Forkers

5i1ver

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.