semvec/pypi-packages huggingface dataset:
supremacy1914-wrapper 0.1.4
Supremacy1914 API wrapper in Python

# Supremacy 1914 API Wrapper

This unofficial API wrapper is an implementation of the Supremacy 1914 API.
This wrapper support API data as far as known and is intended to be easy to use.
You'll only need to supply the server URL and the game\_id before you'll be able to get data.

## Install

```bash
$ pip install supremacy1914-wrapper
```

## Demo

It's advised to store the server url for the game you want to request. If you don't have the server url you can make a Supremacy instance without the url parameter, wrap it in a try except to get the server url.

```python
from supremacy1914_wrapper import Supremacy, ServerChangeError 

# Create a Supremacy instance using game id
supremacy = Supremacy("2502620")

# Send a request and except server change error
try:
    result = supremacy.players()
except ServerChangeError as exception:
    # update the url in the Supremacy instance
    supremacy.url = str(exception)
    result = supremacy.players()
```

When you have to server url from the game you can pass it into the Supremacy constructor. Make sure to use a try except because the server changes over time.

```python
from supremacy1914_wrapper import Supremacy, ServerChangeError 

# Create a Supremacy instance using game id and server url
supremacy = Supremacy("2502620", "http://xgs1.c.bytro.com")

# Send a request and except server change error
try:
    result = supremacy.players()
except ServerChangeError as exception:
    # update the url in the Supremacy instance
    supremacy.url = str(exception)
    result = supremacy.players()
```

## Documentation

Other information about functions and exceptions can be found on the [wiki.](https://github.com/joostsijm/supremacy1914_wrapper/wiki)

## Tests

Testing is done with PyTest, to run the tests use the command `pytest`. The following environment variables are required: `TEST_GAME_ID` and `TEST_GAME_URL`, save those in the `.env` file for convince

## Development

I'll try to improve the wrapper as far as I need.
If you'd like to see a new feature you can open an issue or make pull request.
cjworkbench-re2 0.0.7a0
RE2 Python bindings
Requires Python: ~=3.6

A drop-in replacement for the re module.

It uses RE2 under the hood, of course, so various PCRE features
(e.g. backreferences, look-around assertions) are not supported.

Known differences between this API and the re module's API:

  * The error class does not provide any error information as attributes.
  * The Options class replaces the re module's flags with RE2's options as
    gettable/settable properties. Please see re2.h for their documentation.
  * The pattern string and the input string do not have to be the same type.
    Any Text (unicode in Python 2, str in Python 3) will be encoded to UTF-8.
  * The pattern string cannot be Text if the options specify Latin-1 encoding.

Known issues with regard to building the C++ extension:

  * Building requires RE2 and pybind11 to be installed on your system.
    On Debian, for example, install the libre2-dev and pybind11-dev packages.
  * Building on macOS has not been tested yet and will possibly fail.
  * Building on Windows has not been tested yet and will probably fail.
reddit-regex-counter 0.0.2
Count the number of regex matches within a subreddit
Requires Python: >=3, <4
Keywords: reddit

# reddit-regex-counter
Count the number of regular expression matches within a subreddit.

## Description
This package is a wrapper for [psaw](https://github.com/dmarx/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](https://pypi.org/), 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/>.