文件管理自动化工具

organize-tool的Python项目详细描述


https://github.com/tfeldmann/organize/raw/master/docs/images/organize.svg?sanitize=trueDocumentation Statushttps://travis-ci.org/tfeldmann/organize.svg?branch=master

组织

文件管理自动化工具。

通过pip安装(要求:python 3.4+):

在MacOS/Windows上: $ pip3 install organize-tool

在Linux上: $ sudo pip3 install organize-tool

完整的文档位于https://organize.readthedocs.io/

为什么你会觉得这个有用

你的桌面一团糟?你在下载中找不到任何东西 文件?手工对所有这些文件进行排序和重命名是不是太繁琐了? 是时候让它自动化一次并永远受益于它了。

organize是一个命令行,是hazel(macos)等应用程序的开源替代品。 或者文件杂耍者(windows)。

在shell中,运行$ organize config编辑配置:

  • config.yaml

    rules:# move screenshots into "Screenshots" folder-folders:-~/Desktopfilters:-filename:startswith:'ScreenShot'actions:-move:~/Desktop/Screenshots/# move incomplete downloads older > 30 days into the trash-folders:-~/Downloadsfilters:-extension:-download-crdownload-part-lastmodified:days:30mode:olderactions:-trash

(或者,您可以运行$ organize config --path查看 您的config.yaml

$ organize run现在…

  • 将所有屏幕快照从桌面移到“屏幕快照”子文件夹 (如果不存在该文件夹,将创建)
  • 将超过30天的所有未完成下载放入垃圾桶

就这么简单。

感到不安全?运行$ organize sim查看如果没有 触摸你的文件。

但还有更多。要重命名/复制文件,运行自定义shell或python 脚本、将文件名与正则表达式匹配或使用占位符变量? 你有没有参加过。

高级使用示例

此示例显示了一些高级功能,如占位符变量、可插入 通过子文件夹的操作和递归:

rules:-folders:~/Documents/**/*filters:-extension:-pdf-docx-lastmodifiedactions:-move:'~/Documents/{extension.upper}/{lastmodified.year}-{lastmodified.month:02}/'-shell:'open"{path}"'

假设我们的~/Documents文件夹(或其任何子文件夹)中有两个文件 从2018年1月起命名为^{TT10}$,从2016年12月起命名为^{TT11}$。 发生时间:

  • script.docx将移动到~/Documents/DOCX/2018-01/script.docx
  • demo.pdf将移动到~/Documents/PDF/2016-12/demo.pdf
  • 这些文件将从它们的新位置打开(opencommand in macos)。

命令行界面

The file management automation tool.

Usage:
    organize sim [--config-file=<path>]
    organize run [--config-file=<path>]
    organize config [--open-folder | --path | --debug] [--config-file=<path>]
    organize list
    organize --help
    organize --version

Arguments:
    sim             Simulate a run. Does not touch your files.
    run             Organizes your files according to your rules.
    config          Open the configuration file in $EDITOR.
    list            List available filters and actions.
    --version       Show program version and exit.
    -h, --help      Show this screen and exit.

Options:
    -o, --open-folder  Open the folder containing the configuration files.
    -p, --path         Show the path to the configuration file.
    -d, --debug        Debug your configuration file.

Full documentation: https://organize.readthedocs.io

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java游戏!框架伪造应用程序它实际上做什么?   java如何在JavaFx中显示表视图中的即时更改?   对象类的equals()方法的java重载   xpages介绍如何部署java。IBM Notes中的策略更改   java如何访问侦听器中的另一个视图?   java getDefaultDisplay()的替代方法是什么   java opencv匹配模板   java Android Firebase写入数据时的常量超时   在Java中,如何将包含大量空格的数字字符串转换为一系列Int变量。   带有GUI的swing Java模拟无法运行模拟   java NoSuchElementException在特定的Web端上使用无头铬和硒   java对文件进行迭代,即使文件在目录中也会出现“未找到文件”异常。你能告诉我为什么吗?谢谢   递归Java 8,匿名递归嵌套方法   java为什么我看到枚举常量的字段值会被序列化/反序列化?在哪种情况下,枚举中哪些内容没有序列化?   java在运行sonar scanner和Spotbugs规则时出错,用于单片项目?   java如何检查硬件键盘是否可用?(黑莓)   tile游戏动作侦听器循环中的java错误   sockets Java线程池与高请求场景中的新线程   java如何使用Hibernate注释在联接表上创建索引?