bridgeobjects 0.1.30__tar.gz → 0.1.32__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. bridgeobjects-0.1.32/PKG-INFO +36 -0
  2. {bridgeobjects-0.1.30 → bridgeobjects-0.1.32}/README.md +10 -10
  3. bridgeobjects-0.1.32/pyproject.toml +15 -0
  4. bridgeobjects-0.1.32/src/bridgeobjects/__init__.py +39 -0
  5. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/_parse_lin_string.py +0 -2
  6. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/_parse_pbn_string.py +0 -2
  7. bridgeobjects-0.1.32/src/bridgeobjects/_version.py +1 -0
  8. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/constants.py +3 -1
  9. bridgeobjects-0.1.30/LICENSE.txt +0 -650
  10. bridgeobjects-0.1.30/PKG-INFO +0 -368
  11. bridgeobjects-0.1.30/bridgeobjects/__init__.py +0 -38
  12. bridgeobjects-0.1.30/bridgeobjects/_version.py +0 -1
  13. bridgeobjects-0.1.30/bridgeobjects/src/__init__.py +0 -0
  14. bridgeobjects-0.1.30/bridgeobjects/tests/__init__.py +0 -0
  15. bridgeobjects-0.1.30/bridgeobjects/tests/test_auctions.py +0 -97
  16. bridgeobjects-0.1.30/bridgeobjects/tests/test_boards.py +0 -581
  17. bridgeobjects-0.1.30/bridgeobjects/tests/test_calls.py +0 -242
  18. bridgeobjects-0.1.30/bridgeobjects/tests/test_cards.py +0 -185
  19. bridgeobjects-0.1.30/bridgeobjects/tests/test_contracts.py +0 -151
  20. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/lin_input_file_1.lin +0 -33
  21. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_auction_1.pbn +0 -47
  22. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_auction_2.pbn +0 -47
  23. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_input_3.pbn +0 -120
  24. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_input_file_1.pbn +0 -1287
  25. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_output_file_1.pbn +0 -29
  26. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/rbn_input_file_1.rbn +0 -24
  27. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/rbn_output_file_1.rbn +0 -124
  28. bridgeobjects-0.1.30/bridgeobjects/tests/test_denominations.py +0 -139
  29. bridgeobjects-0.1.30/bridgeobjects/tests/test_events.py +0 -66
  30. bridgeobjects-0.1.30/bridgeobjects/tests/test_hands.py +0 -946
  31. bridgeobjects-0.1.30/bridgeobjects/tests/test_lin.py +0 -218
  32. bridgeobjects-0.1.30/bridgeobjects/tests/test_pbn.py +0 -233
  33. bridgeobjects-0.1.30/bridgeobjects/tests/test_rbn.py +0 -215
  34. bridgeobjects-0.1.30/bridgeobjects/tests/test_scores.py +0 -449
  35. bridgeobjects-0.1.30/bridgeobjects/tests/test_suits.py +0 -134
  36. bridgeobjects-0.1.30/bridgeobjects/tests/test_trick.py +0 -61
  37. bridgeobjects-0.1.30/bridgeobjects.egg-info/PKG-INFO +0 -368
  38. bridgeobjects-0.1.30/bridgeobjects.egg-info/SOURCES.txt +0 -51
  39. bridgeobjects-0.1.30/bridgeobjects.egg-info/dependency_links.txt +0 -1
  40. bridgeobjects-0.1.30/bridgeobjects.egg-info/top_level.txt +0 -1
  41. bridgeobjects-0.1.30/setup.cfg +0 -4
  42. bridgeobjects-0.1.30/setup.py +0 -57
  43. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/_create_pbn_string.py +0 -0
  44. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/_file_constants.py +0 -0
  45. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/_parse_rbn_string.py +0 -0
  46. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/auction.py +0 -0
  47. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/board.py +0 -0
  48. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/call.py +0 -0
  49. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/card.py +0 -0
  50. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/contract.py +0 -0
  51. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/denomination.py +0 -0
  52. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/event.py +0 -0
  53. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/file_operations.py +0 -0
  54. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/hand.py +0 -0
  55. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/suit.py +0 -0
  56. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/suit_base.py +0 -0
  57. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.32/src/bridgeobjects}/trick.py +0 -0
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.3
2
+ Name: bridgeobjects
3
+ Version: 0.1.32
4
+ Summary: A collection of modules that allows the user to utilise objects used in bridge games, for example, a board or a contract.
5
+ Author: Jeff
6
+ Author-email: Jeff <<jeffwatkins2000@gmail.com>>
7
+ Requires-Python: ==3.13.*
8
+ Description-Content-Type: text/markdown
9
+
10
+ # bridgeobjects
11
+ A collection of modules that allows the user to utilise objects used in bridge games, for example, a board or a contract.
12
+
13
+ The classes form a natural hierarchy:
14
+
15
+ event
16
+ └── board
17
+ ├── auction
18
+ │   └── call
19
+ │   └── denomination
20
+ ├── contract
21
+ ├── hand
22
+ │   └── card
23
+ │   └── suit
24
+ └── trick
25
+
26
+ (However, some classes are natural subsidiaries not represented in this classification, for example, there are four cards in a trick.)
27
+
28
+
29
+ The objects can be created using a simple, self explanatory, human readable set of definitions
30
+ by using Portable Bridge Notation (PBN) (http://www.tistis.nl/pbn/) or
31
+ Richard’s Bridge Notation (RBN) (http://www.rpbridge.net/7a12.htm).
32
+
33
+ ## Installation
34
+ ```bash
35
+ pip install bridgeobjects
36
+ ```
@@ -3,16 +3,16 @@ A collection of modules that allows the user to utilise objects used in bridge g
3
3
 
4
4
  The classes form a natural hierarchy:
5
5
 
6
- event
7
- └── board
8
- ├── auction
9
- │   └── call
10
- │   └── denomination
11
- ├── contract
12
- ├── hand
13
- │   └── card
14
- │   └── suit
15
- └── trick
6
+ event
7
+ └── board
8
+ ├── auction
9
+ │   └── call
10
+ │   └── denomination
11
+ ├── contract
12
+ ├── hand
13
+ │   └── card
14
+ │   └── suit
15
+ └── trick
16
16
 
17
17
  (However, some classes are natural subsidiaries not represented in this classification, for example, there are four cards in a trick.)
18
18
 
@@ -0,0 +1,15 @@
1
+ [project]
2
+ name = "bridgeobjects"
3
+ version = "0.1.32"
4
+ requires-python = '==3.13.*'
5
+ description = "A collection of modules that allows the user to utilise objects used in bridge games, for example, a board or a contract."
6
+ authors = [{name = "Jeff", "email" = "<jeffwatkins2000@gmail.com>"}]
7
+ readme = "README.md"
8
+ include = ["HISTORY.md"]
9
+
10
+ [dependency-groups]
11
+ dev = ['pytest']
12
+
13
+ [build-system]
14
+ requires = ['uv-build']
15
+ build-backend = 'uv_build'
@@ -0,0 +1,39 @@
1
+
2
+
3
+ """
4
+ The bridgeobjects package exposes the following classes:
5
+ (inspect the individual modules to see their APIs):
6
+
7
+ constants: various constants used throughout the package,
8
+ e.g. SEATS = ['N', 'E', 'S', 'W'];
9
+ board: represents a board of 4 hands;
10
+ hand: holds the 13 cards dealt to the hand;
11
+ card: a single card in a hand, board or trick;
12
+ suit: one of Spades, Hearts, Clubs or diamonds;
13
+ denomination: the name of a call in the auction or contract,
14
+ it includes the four suits and NT;
15
+ auction: the calls made on a particular board
16
+ contract: the contract reach on a board;
17
+ call: an individual call made to reach a contract
18
+ event: the match or competition at which the boards are played:
19
+ trick: four cards played which one pair wins:
20
+ file_operations: a module to load or save events in a PBN,
21
+ RBN or LIN format.
22
+ """
23
+
24
+
25
+ from bridgeobjects.constants import *
26
+ from bridgeobjects.board import *
27
+ from bridgeobjects.hand import *
28
+ from bridgeobjects.card import *
29
+ from bridgeobjects.suit import *
30
+ from bridgeobjects.auction import *
31
+ from bridgeobjects.contract import *
32
+ from bridgeobjects.call import *
33
+ from bridgeobjects.event import *
34
+ from bridgeobjects.trick import *
35
+ from bridgeobjects.file_operations import *
36
+ from bridgeobjects.denomination import *
37
+
38
+ from ._version import __version__
39
+ VERSION = __version__
@@ -25,10 +25,8 @@ from .suit import Suit
25
25
  from .hand import Hand
26
26
  from .card import Card
27
27
  from .constants import SEATS
28
- # from ._file_constants import
29
28
  from ._file_constants import LIN_VULNERABILITY_CONVERSION
30
29
 
31
- from termcolor import cprint
32
30
 
33
31
  MODULE_COLOUR = 'red'
34
32
 
@@ -54,14 +54,12 @@ def parse_pbn(file_lines: list[str]) -> list[Event]:
54
54
  if not value:
55
55
  value = str(uuid.uuid1()) # Dummy event
56
56
  value = DEFAULT_EVENT_NAME
57
- # ic(f'{DEFAULT_EVENT_NAME=}')
58
57
  if current_event != value:
59
58
  current_event = value
60
59
  current_board_identifier = ""
61
60
  board_index = 0
62
61
  # if value and value != DEFAULT_EVENT_NAME:
63
62
  if value:
64
- ic(value)
65
63
  event = Event(str(value))
66
64
  events.append(event)
67
65
 
@@ -0,0 +1 @@
1
+ __version__ = '0.1.32'
@@ -3,7 +3,7 @@
3
3
  __all__ = ['SEATS', 'ROLES', 'VULNERABLE', 'VULNERABILITY',
4
4
  'CALLS', 'CONTRACTS', 'SUIT_NAMES', 'DENOMINATION_NAMES',
5
5
  'RANKS', 'SUITS', 'BALANCED_SHAPES', 'SEMI_BALANCED_SHAPES',
6
- 'SHAPES', 'SHAPE_PROBABILITIES', 'HONOUR_POINTS',
6
+ 'SHAPES', 'SHAPE_PROBABILITIES', 'HONOUR_POINTS', 'SUIT_SYMBOLS',
7
7
  'CARD_NAMES', 'CARD_VALUES', 'DISPLAY_SUIT_ORDER']
8
8
 
9
9
  from .suit import Clubs, Diamonds, Hearts, Spades
@@ -68,6 +68,8 @@ RANKS = ['x', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A']
68
68
 
69
69
  #: Suits dictionary
70
70
  SUITS = {'C': Clubs(), 'D': Diamonds(), 'H': Hearts(), 'S': Spades()}
71
+ # unicode
72
+ SUIT_SYMBOLS = {'S': '\u2660', 'H': '\u2665', 'D': '\u2666', 'C': '\u2663'}
71
73
 
72
74
  DISPLAY_SUIT_ORDER = 'SHCD'
73
75