semvec/pypi-packages huggingface dataset:
mw-api-client 3.2.2
A simple MediaWiki client.
License: MIT
Requires Python: >=2.7
Keywords: mediawiki api requests


A really simple MediaWiki API client.

Can use most MediaWiki API modules.

Requires the ``requests`` library.

http://www.mediawiki.org/

Installation
============

To install the latest stable version::

    pip install -U mw-api-client

To install the latest development (likely unstable) version::

    git clone https://github.com/Kenny2github/mw-api-client.git
    cd mw-api-client
    python setup.py install

Example Usage
=============

.. code-block:: python

    import mw_api_client as mw

Get a page:

.. code-block:: python

    wp = mw.Wiki("https://en.wikipedia.org/w/api.php", "MyCoolBot/0.0.0")

    wp.login("kenny2wiki", password)

    sandbox = wp.page("User:Kenny2wiki/sandbox")

Edit page:

.. code-block:: python

    # Get the page
    contents = sandbox.read()

    # Change
    contents += "\n This is a test!"
    summary = "Made a test edit"

    # Submit
    sandbox.edit(contents, summary)

List pages in category:

.. code-block:: python

    for page in wp.category("Redirects").categorymembers():
        print(page.title)

Remove all uses of a template:

.. code-block:: python

    stub = wp.template("Stub")

    # Pages that transclude stub, main namespace only
    target_pages = list(stub.transclusions(namespace=0))

    # Sort by title because it's prettier that way
    target_pages.sort(key=lambda p: p.title)

    for page in target_pages:
        page.replace("{{stub}}", "")

Patrol all recent changes in the Help namespace:

.. code-block:: python

    rcs = wp.recentchanges(rcnamespace=12)

    for rc in rcs:
        rc.patrol()


Made by Kenny2github, based off of ~blob8108's Scratch Wiki API client.

MIT Licensed.
yaml2pyclass-mecher 0.1.8
Add option to choose final class in config
License: MIT
Requires Python: >=3.7.0

[![PyPI](https://github.com/a-nau/yaml2pyclass/actions/workflows/pypi_publish.yml/badge.svg)](https://github.com/a-nau/yaml2pyclass/actions/workflows/pypi_publish.yml)
[![test](https://github.com/a-nau/yaml2pyclass/workflows/test/badge.svg)](https://github.com/a-nau/yaml2pyclass/actions)

# yaml2pyclass Code Generator

This package enables you to easily generate and instantiate dataclasses from an input `YAML` file. For example
this `YAML` file

```yaml
image_size: [ 1280, 960 ]
cluster_config:
  eps: 0.02
  min_num_samples: 10
path_output: "./output"
```

automatically converts to a Python `class`

```python
import dataclasses
import yaml2pyclass

class Config(yaml2pyclass.CodeGenerator):
    @dataclasses.dataclass
    class ClusterConfigClass:
        eps: float
        min_num_samples: int

    image_size: list
    cluster_config: ClusterConfigClass
    path_output: str
```

In addition to code creation, an instance of the generated class that is initialized with the `YAML`s values can be
created automatically.

The use case it was primarily developed for is facilitating code completion for arbitrary `YAML` config files.
Using `YAML` files as input config allows flexible and general information passing, however, when
using [`pyyaml`](https://pypi.org/project/PyYAML/) the
information is saved as a `dict` which does not support any automatic code completion. This means, that you need to know
the exact variable names for access.

Using this package you can enjoy `YAML`s flexibility and generality, while additionally providing the benefit of code
completion and type specific suggestions from your IDE. Thus, no need to memorize exact variable names or types.

## Installation

You can install the package using `pip`

```shell
pip install yaml2pyclass
```

## Usage

### File Update

To update an existing file, as e.g. in the case of a config file, you need to create a base file. The base file (e.g.
at `path/to/config.py`) should simply contain a class, that inherits from the `yaml2pyclass` base class `CodeGenerator`:

```python
import yaml2pyclass


class Config(yaml2pyclass.CodeGenerator):
    # content is updated automatically from the specified YAML file
    pass
```

Then, in the function where you want to use this class based on the `YAML` input, import the created class and call
the `from_yaml` function

```python
from path.to.config import Config  # import the class Config from the path/to/config.py file

config = Config.from_yaml("config.yaml")
```

This will update the file of the `Config` class with dataclass that matches the input `YAML`.

## Contributors

This project is a collaboration with [Felix Hertlein](https://github.com/FelixHertlein).

## License

This code is distributed under the 3-Clause BSD License, see [LICENSE](LICENSE).