sweeping-view


Namesweeping-view JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/ralokt/sweeping-view/
SummaryReaders for Minesweeper replays
upload_time2024-08-31 21:30:20
maintainerNone
docs_urlNone
authorThomas Kolar
requires_pythonNone
licenseMIT
keywords minesweeper replay readers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sweeping View

Sweeping view is a library that can parse replay files produced by official
Minesweeper clones, as well as Metasweeper.

It's fairly bare-bones, and doesn't do much more than parse replay files. If
you want to do actual analysis of replay files, even just getting board events
from mouse events, you probably want to use `ms-toollib` instead (see below).

## Currently supported:

Formats:
 - RMV (Viennasweeper)
 - AVF (Minesweeper Arbiter, Freesweeper)
 - EVF (Metasweeper)

Tested Python versions:
 - 3.6
 - 3.7
 - 3.8
 - 3.9
 - 3.10
 - 3.11
 - 3.12

## Is this a good idea? Shouldn't the formats be secret?

They aren't anymore anyway. There are open-source tools available to convert
the implemented formats to rawvf, an entirely text-based format.

What this library doesn't do is make any attempt to verify checksums. Those
remain as the primary obstacle to generating fake replays.

## Similar projects

### `ms-toollib`

`ms-toollib` is a library that provides way more features than `sweeping-view`.

Besides replay parsing, it also provides a fully featured minesweeper engine,
as well as numerous algorithms. It is written in Rust, but there is a Python
package of the same name on PyPI.
https://github.com/eee555/ms-toollib/

On the other hand, `sweeping-view` is pure Python and has zero dependencies -
so if all you need is metadata, it might be all you need!

### Rawvf

Rawvf is a plain-text minesweeper replay format. A collection of command line
tools to convert various formats to it can be found here:
https://github.com/thefinerminer/minesweeper-rawvf

Rawvf offers far better support (more formats/old versions of formats), but the
tools aren't usable as libraries.

## State of completion and stability

This library is still a work in progress, and parts of the public API may
change completely - this is because while all existing parsers work for now,
not much care has been taken to make them consistent.

## Example use

### Arbiter

#### code
```python
from sweeping_view.avf import AVFReplay

avf = AVFReplay.from_file("HI-SCORE Beg_5.41_3BV=28_3BVs=5.17_Tommy.avf")

print(avf.name)
print(avf.properties)
print(avf.mines)
```

#### output

```python
'Tommy'
{'level': 'beginner', 'questionmarks': False}
[(4, 1), (5, 2), (8, 2), (2, 3), (6, 3), (4, 5), (8, 5), (6, 6), (8, 6), (4, 7)]
```

### Viennasweeper

#### code
```python
from sweeping_view.rmv import RMVReplay

rmv = RMVReplay.from_file("fd60_beg_4153_NF_1600544477.rmv")

print(rmv.player_data)
print(rmv.properties)
print(rmv.mines)
```

#### output

```python
{'name': 'tkolar'}
{'questionmarks': False, 'nonflagging': True, 'mode': 'normal', 'level': 'beginner'}
[(1, 3), (2, 3), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 4), (6, 6), (7, 6)]
```

### Metasweeper

#### code
```python
from sweeping_view.evf import EVFReplay

evf = EVFReplay.from_file("test_subject.evf")

print(evf.user_identifier)
print(rmv.bbbv)
print(rmv.timeth)
```

#### output

```python
Szymon_M
167
69597
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ralokt/sweeping-view/",
    "name": "sweeping-view",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "minesweeper, replay, readers",
    "author": "Thomas Kolar",
    "author_email": "thomaskolar90@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/07/70b1d70c31e65896ed020e8d880ee07f8ad6831dd33fe63cbf748b47cc4e/sweeping_view-0.3.2.tar.gz",
    "platform": "all",
    "description": "# Sweeping View\n\nSweeping view is a library that can parse replay files produced by official\nMinesweeper clones, as well as Metasweeper.\n\nIt's fairly bare-bones, and doesn't do much more than parse replay files. If\nyou want to do actual analysis of replay files, even just getting board events\nfrom mouse events, you probably want to use `ms-toollib` instead (see below).\n\n## Currently supported:\n\nFormats:\n - RMV (Viennasweeper)\n - AVF (Minesweeper Arbiter, Freesweeper)\n - EVF (Metasweeper)\n\nTested Python versions:\n - 3.6\n - 3.7\n - 3.8\n - 3.9\n - 3.10\n - 3.11\n - 3.12\n\n## Is this a good idea? Shouldn't the formats be secret?\n\nThey aren't anymore anyway. There are open-source tools available to convert\nthe implemented formats to rawvf, an entirely text-based format.\n\nWhat this library doesn't do is make any attempt to verify checksums. Those\nremain as the primary obstacle to generating fake replays.\n\n## Similar projects\n\n### `ms-toollib`\n\n`ms-toollib` is a library that provides way more features than `sweeping-view`.\n\nBesides replay parsing, it also provides a fully featured minesweeper engine,\nas well as numerous algorithms. It is written in Rust, but there is a Python\npackage of the same name on PyPI.\nhttps://github.com/eee555/ms-toollib/\n\nOn the other hand, `sweeping-view` is pure Python and has zero dependencies -\nso if all you need is metadata, it might be all you need!\n\n### Rawvf\n\nRawvf is a plain-text minesweeper replay format. A collection of command line\ntools to convert various formats to it can be found here:\nhttps://github.com/thefinerminer/minesweeper-rawvf\n\nRawvf offers far better support (more formats/old versions of formats), but the\ntools aren't usable as libraries.\n\n## State of completion and stability\n\nThis library is still a work in progress, and parts of the public API may\nchange completely - this is because while all existing parsers work for now,\nnot much care has been taken to make them consistent.\n\n## Example use\n\n### Arbiter\n\n#### code\n```python\nfrom sweeping_view.avf import AVFReplay\n\navf = AVFReplay.from_file(\"HI-SCORE Beg_5.41_3BV=28_3BVs=5.17_Tommy.avf\")\n\nprint(avf.name)\nprint(avf.properties)\nprint(avf.mines)\n```\n\n#### output\n\n```python\n'Tommy'\n{'level': 'beginner', 'questionmarks': False}\n[(4, 1), (5, 2), (8, 2), (2, 3), (6, 3), (4, 5), (8, 5), (6, 6), (8, 6), (4, 7)]\n```\n\n### Viennasweeper\n\n#### code\n```python\nfrom sweeping_view.rmv import RMVReplay\n\nrmv = RMVReplay.from_file(\"fd60_beg_4153_NF_1600544477.rmv\")\n\nprint(rmv.player_data)\nprint(rmv.properties)\nprint(rmv.mines)\n```\n\n#### output\n\n```python\n{'name': 'tkolar'}\n{'questionmarks': False, 'nonflagging': True, 'mode': 'normal', 'level': 'beginner'}\n[(1, 3), (2, 3), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 4), (6, 6), (7, 6)]\n```\n\n### Metasweeper\n\n#### code\n```python\nfrom sweeping_view.evf import EVFReplay\n\nevf = EVFReplay.from_file(\"test_subject.evf\")\n\nprint(evf.user_identifier)\nprint(rmv.bbbv)\nprint(rmv.timeth)\n```\n\n#### output\n\n```python\nSzymon_M\n167\n69597\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Readers for Minesweeper replays",
    "version": "0.3.2",
    "project_urls": {
        "Homepage": "https://github.com/ralokt/sweeping-view/"
    },
    "split_keywords": [
        "minesweeper",
        " replay",
        " readers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3df47683bd8a0349a37bc8ac1b6a7d8591038d8acae94ef247f828dff539004a",
                "md5": "a37733b24aba60c54dc7133308d1ddc4",
                "sha256": "1098c2fd2d05ba40eb7c799018eed8e21c14cfd67b4d45e28d9bc7e43fe67fa8"
            },
            "downloads": -1,
            "filename": "sweeping_view-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a37733b24aba60c54dc7133308d1ddc4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11354,
            "upload_time": "2024-08-31T21:30:17",
            "upload_time_iso_8601": "2024-08-31T21:30:17.112726Z",
            "url": "https://files.pythonhosted.org/packages/3d/f4/7683bd8a0349a37bc8ac1b6a7d8591038d8acae94ef247f828dff539004a/sweeping_view-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f0770b1d70c31e65896ed020e8d880ee07f8ad6831dd33fe63cbf748b47cc4e",
                "md5": "d2923ddaf53dcf61b7643fdf3b0f7735",
                "sha256": "e07f34a44b6a7a9b1ab86e93041fa8c23ccb55fa8604e43e5676c782eae2395a"
            },
            "downloads": -1,
            "filename": "sweeping_view-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d2923ddaf53dcf61b7643fdf3b0f7735",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 55279,
            "upload_time": "2024-08-31T21:30:20",
            "upload_time_iso_8601": "2024-08-31T21:30:20.603354Z",
            "url": "https://files.pythonhosted.org/packages/5f/07/70b1d70c31e65896ed020e8d880ee07f8ad6831dd33fe63cbf748b47cc4e/sweeping_view-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-31 21:30:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ralokt",
    "github_project": "sweeping-view",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "sweeping-view"
}
        
Elapsed time: 0.54896s