Skip to main content

Abstract games stuff

Install

pip install AGStuff

Requirements

  • python>=3.6

Usage

Cards

>>> from agstuff.cards.core import Card, Cards, Deck
>>>
>>> card1 = Card('As')
>>> card1
A♠
>>> card2 = Card('8d')
>>> card2
8♦
>>> card1 > card2
True
>>>
>>> cards = Cards('As/Ks/Qs')
>>> cards
[A♠, K♠, Q♠]
>>> card1 in cards
True
>>>
>>> cards = Cards(cards=(card2, Card('Tc'), Card('4h')))
>>> cards
[8♦, 4♥, T♣]
>>> card2 in cards
True
>>>
>>> deck = Deck()
>>> cards = Cards()
>>> cards.pull(deck, 5)
>>> cards
[9♥, 2♦, 8♣, 6♠, K♥]

Dices

>>> from agstuff.dices.core import Dice, DiceBox
>>>
>>> dice1 = Dice(faces_count=6)
>>> dice1
1 of [1, 2, 3, 4, 5, 6]
>>> dice2 = Dice(6)
>>> dice2
6 of [1, 2, 3, 4, 5, 6]
>>> dice1.rolling()
5
>>> dice1
5 of [1, 2, 3, 4, 5, 6]
>>> dice2.rolling()
1
>>> dice2
1 of [1, 2, 3, 4, 5, 6]
>>> dice1 + dice2
6
>>> dice1 > dice2
True
>>>
>>> dice3 = Dice(faces_items=('Q', 'W', 'E', 'R', 'T', 'Y'))
>>> dice3
E of ['Q', 'W', 'E', 'R', 'T', 'Y']
>>> dice3.rolling()
'Y'
>>> dice3
Y of ['Q', 'W', 'E', 'R', 'T', 'Y']
>>>
>>> dice_box = DiceBox()
>>> dice_box.add(dice1)
>>> dice_box.add(dice2)
>>> dice_box.rolling()
8
>>> dice1
5 of [1, 2, 3, 4, 5, 6]
>>> dice2
3 of [1, 2, 3, 4, 5, 6]
>>> dice1.value
5
>>> dice2.value
3

Metadata

Release files for AGStuff 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AGStuff 1.1.0
File Size Uploaded Provenance Actions
AGStuff-1.1.0.tar.gz 10.3 kB Without provenance Details for AGStuff-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AGStuff 1.1.0
File Interpreter ABI Platform Actions
AGStuff-1.1.0-py3-none-any.whl Python 3 none any Details for AGStuff-1.1.0-py3-none-any.whl

Total release size: 25.8 kB

Release files / AGStuff-1.1.0.tar.gz

Download URL AGStuff-1.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a4569f3bc6b049c0b0ffdbf977059493d3abc12ca267ec111e473201e24f4fdd
BLAKE2b-256 checksum
How to use checksums
bb1f73bd4b5b5235c11795ffea4d60a6c77c223a5b08a4b42e008f7bb51b986f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7

Release files / AGStuff-1.1.0-py3-none-any.whl

Download URL AGStuff-1.1.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99d14f750b84cac7afebb58fe9c7162550652be790548dfca61e488e4ad5eb27
BLAKE2b-256 checksum
How to use checksums
90f9ebba2000490d578d2c1340f07b7ac2559d2efee3fa866f7eaf1d54d643bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7

Security for AGStuff 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page