Metadata-Version: 2.1
Name: bgameb
Version: 0.0.39
Summary: Board Game Builder
Home-page: https://github.com/KonstantinKlepikov/BoardGameBuilder
Author: Konstantin Klepikov
Author-email: oformleno@gmail.com
License: MIT
Project-URL: Docs, https://konstantinklepikov.github.io/BoardGameBuilder/
Project-URL: Source, https://github.com/KonstantinKlepikov/BoardGameBuilder
Keywords: framework
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: incremental (==21.3.0)
Requires-Dist: dataclasses-json (==0.5.7)
Requires-Dist: loguru (==0.6.0)
Provides-Extra: dev
Requires-Dist: alabaster (==0.7.12) ; extra == 'dev'
Requires-Dist: asttokens (==2.0.8) ; extra == 'dev'
Requires-Dist: attrs (==22.1.0) ; extra == 'dev'
Requires-Dist: Automat (==20.2.0) ; extra == 'dev'
Requires-Dist: Babel (==2.10.3) ; extra == 'dev'
Requires-Dist: backcall (==0.2.0) ; extra == 'dev'
Requires-Dist: beautifulsoup4 (==4.11.1) ; extra == 'dev'
Requires-Dist: bleach (==5.0.1) ; extra == 'dev'
Requires-Dist: build (==0.8.0) ; extra == 'dev'
Requires-Dist: certifi (>=2022.12.07) ; extra == 'dev'
Requires-Dist: cffi (==1.15.1) ; extra == 'dev'
Requires-Dist: charset-normalizer (==2.1.1) ; extra == 'dev'
Requires-Dist: click (==8.1.3) ; extra == 'dev'
Requires-Dist: click-default-group (==1.2.2) ; extra == 'dev'
Requires-Dist: commonmark (==0.9.1) ; extra == 'dev'
Requires-Dist: constantly (==15.1.0) ; extra == 'dev'
Requires-Dist: cryptography (>=38.0.3) ; extra == 'dev'
Requires-Dist: dataclasses-json (==0.5.7) ; extra == 'dev'
Requires-Dist: decorator (==5.1.1) ; extra == 'dev'
Requires-Dist: docutils (==0.17.1) ; extra == 'dev'
Requires-Dist: executing (==1.0.0) ; extra == 'dev'
Requires-Dist: flake8 (==5.0.4) ; extra == 'dev'
Requires-Dist: hyperlink (==21.0.0) ; extra == 'dev'
Requires-Dist: idna (==3.3) ; extra == 'dev'
Requires-Dist: imagesize (==1.4.1) ; extra == 'dev'
Requires-Dist: importlib-metadata (==4.12.0) ; extra == 'dev'
Requires-Dist: incremental (==21.3.0) ; extra == 'dev'
Requires-Dist: iniconfig (==1.1.1) ; extra == 'dev'
Requires-Dist: ipython (==8.4.0) ; extra == 'dev'
Requires-Dist: jedi (==0.18.1) ; extra == 'dev'
Requires-Dist: jeepney (==0.8.0) ; extra == 'dev'
Requires-Dist: Jinja2 (==3.1.2) ; extra == 'dev'
Requires-Dist: keyring (==23.8.2) ; extra == 'dev'
Requires-Dist: loguru (==0.6.0) ; extra == 'dev'
Requires-Dist: markdown-it-py (==2.1.0) ; extra == 'dev'
Requires-Dist: MarkupSafe (==2.1.1) ; extra == 'dev'
Requires-Dist: marshmallow (==3.17.1) ; extra == 'dev'
Requires-Dist: marshmallow-enum (==1.5.1) ; extra == 'dev'
Requires-Dist: matplotlib-inline (==0.1.6) ; extra == 'dev'
Requires-Dist: mccabe (==0.7.0) ; extra == 'dev'
Requires-Dist: mdit-py-plugins (==0.3.0) ; extra == 'dev'
Requires-Dist: mdurl (==0.1.2) ; extra == 'dev'
Requires-Dist: mypy (==0.982) ; extra == 'dev'
Requires-Dist: mypy-extensions (==0.4.3) ; extra == 'dev'
Requires-Dist: myst-parser (==0.18.0) ; extra == 'dev'
Requires-Dist: packaging (==21.3) ; extra == 'dev'
Requires-Dist: parso (==0.8.3) ; extra == 'dev'
Requires-Dist: pep517 (==0.13.0) ; extra == 'dev'
Requires-Dist: pexpect (==4.8.0) ; extra == 'dev'
Requires-Dist: pickleshare (==0.7.5) ; extra == 'dev'
Requires-Dist: pkginfo (==1.8.3) ; extra == 'dev'
Requires-Dist: pluggy (==1.0.0) ; extra == 'dev'
Requires-Dist: prompt-toolkit (==3.0.30) ; extra == 'dev'
Requires-Dist: ptyprocess (==0.7.0) ; extra == 'dev'
Requires-Dist: pure-eval (==0.2.2) ; extra == 'dev'
Requires-Dist: py (==1.11.0) ; extra == 'dev'
Requires-Dist: pycodestyle (==2.9.1) ; extra == 'dev'
Requires-Dist: pycparser (==2.21) ; extra == 'dev'
Requires-Dist: pyflakes (==2.5.0) ; extra == 'dev'
Requires-Dist: Pygments (==2.13.0) ; extra == 'dev'
Requires-Dist: pyparsing (==3.0.9) ; extra == 'dev'
Requires-Dist: pytest (==7.1.2) ; extra == 'dev'
Requires-Dist: python-dotenv (==0.20.0) ; extra == 'dev'
Requires-Dist: pytz (==2022.2.1) ; extra == 'dev'
Requires-Dist: PyYAML (==6.0) ; extra == 'dev'
Requires-Dist: Random-Word (==1.0.10) ; extra == 'dev'
Requires-Dist: readme-renderer (==37.0) ; extra == 'dev'
Requires-Dist: requests (==2.28.1) ; extra == 'dev'
Requires-Dist: requests-toolbelt (==0.9.1) ; extra == 'dev'
Requires-Dist: rfc3986 (==2.0.0) ; extra == 'dev'
Requires-Dist: rich (==12.5.1) ; extra == 'dev'
Requires-Dist: SecretStorage (==3.3.3) ; extra == 'dev'
Requires-Dist: six (==1.16.0) ; extra == 'dev'
Requires-Dist: snowballstemmer (==2.2.0) ; extra == 'dev'
Requires-Dist: soupsieve (==2.3.2.post1) ; extra == 'dev'
Requires-Dist: Sphinx (==5.1.1) ; extra == 'dev'
Requires-Dist: sphinx-basic-ng (==0.0.1a12) ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme (==1.0.0) ; extra == 'dev'
Requires-Dist: sphinxcontrib-applehelp (==1.0.2) ; extra == 'dev'
Requires-Dist: sphinxcontrib-devhelp (==1.0.2) ; extra == 'dev'
Requires-Dist: sphinxcontrib-htmlhelp (==2.0.0) ; extra == 'dev'
Requires-Dist: sphinxcontrib-jsmath (==1.0.1) ; extra == 'dev'
Requires-Dist: sphinxcontrib-qthelp (==1.0.3) ; extra == 'dev'
Requires-Dist: sphinxcontrib-serializinghtml (==1.1.5) ; extra == 'dev'
Requires-Dist: stack-data (==0.5.0) ; extra == 'dev'
Requires-Dist: tomli (==2.0.1) ; extra == 'dev'
Requires-Dist: towncrier (==21.9.0) ; extra == 'dev'
Requires-Dist: traitlets (==5.3.0) ; extra == 'dev'
Requires-Dist: twine (==4.0.1) ; extra == 'dev'
Requires-Dist: twisted (>=22.10.0rc1) ; extra == 'dev'
Requires-Dist: typing-inspect (==0.8.0) ; extra == 'dev'
Requires-Dist: typing-extensions (==4.3.0) ; extra == 'dev'
Requires-Dist: urllib3 (==1.26.12) ; extra == 'dev'
Requires-Dist: wcwidth (==0.2.5) ; extra == 'dev'
Requires-Dist: webencodings (==0.5.1) ; extra == 'dev'
Requires-Dist: zipp (==3.8.1) ; extra == 'dev'
Requires-Dist: zope.interface (==5.4.0) ; extra == 'dev'

# BoardGameBuilder

!!! Project now is in very early stage. Dont use it in any apps :)

[![Release and upload to pypi](https://github.com/KonstantinKlepikov/BoardGameBuilder/actions/workflows/release.yml/badge.svg)](https://github.com/KonstantinKlepikov/BoardGameBuilder/actions/workflows/release.yml)
[![Deploy static content to Pages](https://github.com/KonstantinKlepikov/BoardGameBuilder/actions/workflows/build-docs.yml/badge.svg)](https://github.com/KonstantinKlepikov/BoardGameBuilder/actions/workflows/build-docs.yml)

Object-oriented framework for build board game logic in python

`pip install bgameb`

## Short example

```python
from typing import Optional
from dataclasses import dataclass
from bgameb import (
    Game, Player, Steps, Step, Deck, Card, Shaker, Dice,
    Bag, log_enable
        )


if __name__ == '__main__':
    log_enable()

    # create the game
    G = Game('one board game')

    # add player
    G.add(Player('Player'))

    # The stuff objects are saved in attribute c.
    # Names are converted to snake case
    player = G.c.player

    # add game tuns order
    G.add(Steps('Steps'))
    G.c.steps.add(Step('step0'))
    G.c.steps.add(Step('step1', priority=1))

    # start new turn
    current_steps = G.c.steps.deal()

    # Game_steps is a priority queue, linked with priority attribute
    last = G.c.steps.pop()

    # add deck object and cards
    G.add(Deck('Deck'))
    G.c.deck.add(
        Card('First', description='story', count=3)
            )
    G.c.deck.add(Card('Second', count=1))

    # Specific arguments is stored to dict attribute `other`
    description = G.c.deck.c.first.other['description']

    # If you need more clear schema, inherite from any class.
    # Additional, we can define _to_relocate mapping -this
    # help move values from some attrs to another or convert some
    # values to related with Game outsade-hosted schema
    @dataclass
    class MyCard(Card):
        description: Optional[str] = None
        some_text: Optional[str] = 'some texts'
        is_open: Optional[bool] = None

        def __post_init__(self) -> None:
            super().__post_init__()
            self._to_relocate = {
                'is_open': 'opened'
                    }

    G.c.deck.add(
        MyCard('Thierd', description='story', count=12)
            )

    # Use default counters of cards
    G.c.deck.c.first.counter['yellow'] = 12
    G.c.deck.c.second.counter['banana'] = 0

    # relocate values
    G.c.deck.c.thierd.relocate()

    # Deal and shuffle deck
    G.c.deck.deal().shuffle()

    # You can add additional attributes directly, but
    # this attributes can not added to the schema
    G.IS_ACTIVE = True

    # Add shaker and dices
    G.add(Shaker('blue shaker'))
    G.c.blue_shaker.add(
        Dice('dice#8', info='some important', sides=8, count=10)
            )

    # and roll dices
    result = G.c.blue_shaker.c.dice_8.roll()

    # Use bag as collection of any items
    G.add(Bag('Bag'))
    G.c.bag.add(Dice('dice'))
    G.c.bag.add(Card('card'))

    # components and technical attrs not added to shcema.
    # You can reconstruct full schema fit build_json() method
    schema = G.relocate_all().to_json()
```

## Documentation

- [docs](https://konstantinklepikov.github.io/BoardGameBuilder/)
- [pypi](https://pypi.org/project/bgameb/)

## Development

[how install project for development](https://konstantinklepikov.github.io/BoardGameBuilder/usage.html).

Typicaly: `pip install -e .[dev]`

### Available cli

`make proj-doc`

`make test`

to check simple scenario use `python tests/check.py`

`make test-pypi` to test deploy to testpypi

`make log` - insert fragmet name to store new about project

`make ipython` run interactive terminal

`make check` check flake8 and mypy

Available fragmet naming:

- .feature: Signifying a new feature.
- .bugfix: Signifying a bug fix.
- .doc: Signifying a documentation improvement.
- .removal: Signifying a deprecation or removal of public API.
- .misc: A ticket has been closed, but it is not of interest to users.

`make draft` - to check changelog output before release.

`make release` - to bump version, build changelog, commit, push tags and changes.

\* for version management are used [incremental](https://github.com/twisted/incremental) and [towncrier](https://pypi.org/project/towncrier/) for changelog
\* project based on [dataclasses-json](https://github.com/lidatong/dataclasses-json)


