Skip to main content

A library for working with cards, decks, and hands in python

Project description

PyCardDeck

PyCardDeck is a python library for working with card decks, cards and hands in python.

Create Cards

from PyCardDeck import Card

ace_spades = Card(14, 'Ace', 'Spades')
print(ace_spades)
print(ace_spades.val)
print(ace_spades.name)
print(ace_spades.suit)
# Output: Ace of Spades
# 14
# Ace
# Spades

Create a Deck

from PyCardDeck import Deck

deck = Deck([]) # the deck is currently empty
print(deck) # output []

Create a Deck with Cards

from PyCardDeck import Deck, Card

ace_spades = Card(14, 'Ace', 'Spades')
king_spades = Card(13, 'King', 'Spades')
deck = Deck([ace_spades, king_spades])
# Output: [{'value': 13, 'name': 'King', 'suit': 'Spades'}, {'value': 14, 'name': 'Ace', 'suit': 'Spades'}]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CardDeckPy-2.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

CardDeckPy-2.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file CardDeckPy-2.1.0.tar.gz.

File metadata

  • Download URL: CardDeckPy-2.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.2 importlib-metadata/3.10.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for CardDeckPy-2.1.0.tar.gz
Algorithm Hash digest
SHA256 e0ea6ba2ecb7bcce09c476100406a59da3c1e1a77a2bda29eb530660dde14172
MD5 90b86d9584ddd02fee865e5d837eed55
BLAKE2b-256 1f668db22d4a13a4fd9a7445903057c000dbfc6dc51fae222e66e36359ce869c

See more details on using hashes here.

File details

Details for the file CardDeckPy-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: CardDeckPy-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.2 importlib-metadata/3.10.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for CardDeckPy-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31af939951c536466b1dbc9715fa2f22817825eeaff302ac2de974d84df32df6
MD5 8df1b01662f8a6868019bab563c4d0e9
BLAKE2b-256 371efcb7309e885b4ed83e50a24e8ceab3961759da3d7e8fcae98e458220e6f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page