计算subreddit中的regex匹配数

reddit-regex-counter的Python项目详细描述


reddit regex计数器

计算子reddit中正则表达式匹配的数量。在

说明

此包是psaw的包装。它允许 用户可以轻松地计算其中正则表达式的匹配数 在一个子版块内的一段时间。正则表达式匹配 存储在字典中,匹配项本身就是键,并且 出现的次数作为值。在

安装

要直接从pypi下载并安装,请运行 以下命令:

pip3 install reddit-regex-counter

或者,直接从Github资源库安装, 请先克隆此存储库,然后运行:

^{pr2}$

使用

usage: reddit-regex-counter [-h] [-s START] [-e END] -n NAME -p PATTERN

Count the number of regex matches within a subreddit

optional arguments:
-h, --help            show this help message and exit
-s START, --start START
                        The starting date of the search period, in the format
                        of %Y-%m-%d (e.g. 2020-01-31)
-e END, --end END     The starting date of the search period, in the format
                        of %Y-%m-%d (e.g. 2020-02-01)
-n NAME, --name NAME  The name of the subreddit
-p PATTERN, --pattern PATTERN
                        The regular expression pattern for matching

输出示例

$ reddit-regex-counter \
    -s 2020-05-17 \
    -e 2020-05-18 \
    -n news \
    -p "\b[A-Z]{3}\b"
Match:  Count:
USA     59
PPP     58
NOT     52
AND     40
CEO     35
YOU     32
GOP     32
THE     31
WHO     29
CNN     28
CCP     27
PPE     27
CIA     23
ALL     22
LOL     19
FBI     18
...

许可证

reddit-regix-counter - count the number of regex matches within a subreddit

Copyright (C) 2020  Fufu Fang

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

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

推荐PyPI第三方库


热门话题
java Jsonify使用Jackson来定义嵌套对象   在Swing中禁用java图形调试   java Selenium Webdriver拖放在Jenkins上不起作用   java我对一个显示器的问题有一个非常不切实际的询问   java增强的“for”循环导致ArrayIndexOutOfBoundsException   ArrayAdapter适用于Java中的安卓编程,字符串数组   linux在Ubuntu上通过PulseAudio播放Java音频文件时出错   java在Spring应用程序中加载内部(类路径)和外部属性文件   java使用Maven连接到mySQL   Java应用程序的设计   websocket在电报api java中与dc的连接   java XMLStreamException,因为xml中的(&N)   java从控制台输出到JTextArea   Java导出文本文件   java实现parseInt方法   java为什么servlet容器会同步对特定资源/servlet的多个请求的访问?   循环中的Java“while”变量   用Java编程一个国际象棋游戏,gameOver布尔不起作用   java如何获得真正的JPanel大小?