This is a repo of some smallTools created by python.
Project description
Brief
This is a repo of some smallTools created by python.
rename_files
- This tool could rename all the files in a directory decided by you. You have
2
choices to rename them.
by order
- If you don't mind the
filename extension
, you could rename all of them at one time.And the new name should be given, the code will add the order automatically.
import rename_files
if __name__ == '__main__':
# replace the directory you want to rename
directory_path = r"D:\Desktop\C++"
rename_files.rename(directory_path, "something", "*")
by filename extension
- For example, if you want to rename all the images, you may type in
jpg
orpng
as followed.
import rename_files
if __name__ == '__main__':
# replace the directory you want to rename
directory_path = r"D:\Desktop\C++"
rename_files.rename(directory_path, "iamge", "jpg")
rename_files.rename(directory_path, "something", "*")
result:
normalize_md
- Usually, when we write the md file, the images in the md file are bundled with the internet. If you want to view the images offline, you should download the images at advanced and modify the image-urls in the md file, which is awful and takes much time! This tool allow you to download the internal images in the md file automatically so that you could view the md file without the internet anymore!
- The algorithm is in-place!You'd better copy the md dir in advance.
import normalize_md
if __name__ == '__main__':
# replace the directory you want to rename
target_directory = r"D:\Desktop\awesome-notes"
normalize_md.process_dir(target_directory)
result:
- before:
- after:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pythonSmallToolsByHanXu-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ece62d87e8f32761d9fa597b0c5e2b46954ed6e70ca17d5eb921b326983f0d0 |
|
MD5 | eadaadf5ad32296988ef05b1c2019433 |
|
BLAKE2b-256 | c00fadc0f27c26b715051f7c02c7d3ed50b3b17f5946d21546d837da9424d955 |
Close
Hashes for pythonSmallToolsByHanXu-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 753d2bc0805dd49bf7b81a70cbfff5af92d23cfa0ed65f417da8c9728f348a8b |
|
MD5 | cec1ed177ee968e938ab33f986b7661d |
|
BLAKE2b-256 | d827602868617590d7e1c9476b66cad2ff961d34bcd0fe0704adeb4f1c65451d |