Count the number of regex matches within a subreddit
Project description
reddit-regex-counter
Count the number of regular expression matches within a subreddit.
Description
This package is a wrapper for psaw. It allows the user to easily count the number of matches of a regular expression within a certain period of time within a subreddit. The regular expression matches are stored in a dictionary, with the matches themselves being the keys, and the number of occurrences as the values.
Installation
To download and install directly from pypi, run the following command:
pip3 install reddit-regex-counter
Alternatively, to directly install from the Github resource repository, please first clone this repository, then run:
pip3 install .
Usage
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
Example Output
$ 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
...
License
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/>.
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
File details
Details for the file reddit_regex_counter-0.0.2.tar.gz
.
File metadata
- Download URL: reddit_regex_counter-0.0.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557db1122ee98854076e18c994b40e0b82765964a675b28f2e09549478e480b3 |
|
MD5 | c48d3e59bb6fe81d3968e5e60b7b5afb |
|
BLAKE2b-256 | e42c0830a028c9d91046c8a8303b1e6f960c9750058973153e66bdf661cfe9bb |
File details
Details for the file reddit_regex_counter-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: reddit_regex_counter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f92479c52e4c73305c346b9c3750d8191e17dee7fb292159a92c2da403b60bbc |
|
MD5 | 33f9102345fce047c6a5b136147f0827 |
|
BLAKE2b-256 | 8fd0a09762e648bc1dbf5616d450624dc39fc290198256b1fce336ba010f6c9e |