Skip to main content

A small package for sequentially renaming files with the same name.

Project description

Sequentially Rename Files

A small rename function I created to handle documents that have the same file name during automated copy jobs. This function will allow the files to be copied by just appending a (#) to the end of the file name similar to how file systems do so. You need to pass the new directory, current file name, and the files extension and the function will return the new name with (#) if no file with the same name already exists.

If 'test.csv' exists, then the new name would become 'test (1).csv'. This would also continue increasing the number if the new names already exist: 'test (1).csv', 'test (2).csv', 'test (3).csv', etc.

seq_rename(new_directory, current_file_name, file_extension):

Sequentially rename documents on your local or networked file system.

pysftp_seq_rename(pysftp.Connection, new_directory, current_file_name, file_extension):

Sequentially rename documents on an FTP/SFTP site using your pysftp Connection.

paramiko_seq_rename(paramiko.SFTPClient, new_directory, current_file_name, file_extension):

Sequentially rename documents on an FTP/SFTP site using your paramiko SFTPClient connection.

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

sequential_rename-1.0.4.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

sequential_rename-1.0.4-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file sequential_rename-1.0.4.tar.gz.

File metadata

  • Download URL: sequential_rename-1.0.4.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for sequential_rename-1.0.4.tar.gz
Algorithm Hash digest
SHA256 ce2ec46b0817b9b7624f45de1a9cb1dd9e01e24d7a3152ba235488d126fab42f
MD5 8c897291c51a0b00a8677ad4e6c32ef0
BLAKE2b-256 2534d78fe8a8dc24292e163ad6b46a0ef1a85ded89cb899d928f0fce1959fa07

See more details on using hashes here.

File details

Details for the file sequential_rename-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sequential_rename-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7a9e7cfc1a06e06409a8764165afba4afb4b54ee97423d40b9569b454965fe86
MD5 004859ad4afc0a60dda34f3cb443765e
BLAKE2b-256 8e51326798749abfcc6b984cb04dca557844fa804394b6976eaed6f46dd7cc2b

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