将命令历史记录记录到分析引擎
Erudite的Python项目详细描述
跟踪文件,并处理它们。
安装
运行pip install erudite或者如果这是您的事情:轻松安装erudite。你会的 如果使用的python小于2.7,还需要获取argparse。
这可能适用于Python3+,但我还没有测试过。
示例
将zsh历史记录的第一个单词发送到[staat](http://www.stathat.com) (当前为默认值):
erudite –parser=zsh_history –logger=StatHatLogger –stathat-key=test@example.com ~/.zsh_history
如果您只是想四处游玩,看看您能做些什么:
erudite –parser=zsh_history –logger=PrintingLogger ~/.zsh_history
开发
解析器(用于分析行)位于erudite/parsers.py和loggers(用于 用解析的行做事情)都在博学/loggers.py中。
贡献
在这个脚本中有更多的选项将是非常棒的。我是 完全接受捐款。但有几件事对我有帮助:
- Your fork should have a topic branch with your feature, requesting to pull against develop
- Please don’t add any requirements for loggers to setup.py - catch ImportError and exit gracefully. (see StatHatLogger for an example)
- If you’re adding a parser, it would be awesome if you could attach some sample input.
- Just for fun, you might want to run pylint against your changes.
- If you’re changing default settings, it’s totally cool. Just ask me first.
- You should add yourself to Authors in the README.
特别是,这里有一些东西/想法是非常棒的:
- Parser for [bash](http://www.gnu.org/software/bash/) history
- Parser for database logs
- Logger for [redis][1]/[mongo][2]/whatever nosql store you want to use
- Logger for [StatsD](https://github.com/etsy/statsd)
- And if you’re feeling particularly ambitious: tests
许可证
请参见license.md(提示:它是apache 2.0)