bridgeobjects 0.1.30__tar.gz → 0.1.31__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.30/PKG-INFO → bridgeobjects-0.1.31/HISTORY.md +6 -42
  2. bridgeobjects-0.1.31/PKG-INFO +41 -0
  3. {bridgeobjects-0.1.30 → bridgeobjects-0.1.31}/README.md +10 -10
  4. {bridgeobjects-0.1.30 → bridgeobjects-0.1.31}/bridgeobjects/__init__.py +15 -15
  5. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/_parse_lin_string.py +0 -2
  6. bridgeobjects-0.1.31/bridgeobjects/_version.py +1 -0
  7. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/constants.py +3 -1
  8. bridgeobjects-0.1.31/bridgeobjects/src/.vscode/settings.json +4 -0
  9. bridgeobjects-0.1.31/pyproject.toml +15 -0
  10. bridgeobjects-0.1.30/bridgeobjects/_version.py +0 -1
  11. bridgeobjects-0.1.30/bridgeobjects/tests/__init__.py +0 -0
  12. bridgeobjects-0.1.30/bridgeobjects/tests/test_auctions.py +0 -97
  13. bridgeobjects-0.1.30/bridgeobjects/tests/test_boards.py +0 -581
  14. bridgeobjects-0.1.30/bridgeobjects/tests/test_calls.py +0 -242
  15. bridgeobjects-0.1.30/bridgeobjects/tests/test_cards.py +0 -185
  16. bridgeobjects-0.1.30/bridgeobjects/tests/test_contracts.py +0 -151
  17. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/lin_input_file_1.lin +0 -33
  18. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_auction_1.pbn +0 -47
  19. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_auction_2.pbn +0 -47
  20. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_input_3.pbn +0 -120
  21. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_input_file_1.pbn +0 -1287
  22. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/pbn_output_file_1.pbn +0 -29
  23. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/rbn_input_file_1.rbn +0 -24
  24. bridgeobjects-0.1.30/bridgeobjects/tests/test_data/rbn_output_file_1.rbn +0 -124
  25. bridgeobjects-0.1.30/bridgeobjects/tests/test_denominations.py +0 -139
  26. bridgeobjects-0.1.30/bridgeobjects/tests/test_events.py +0 -66
  27. bridgeobjects-0.1.30/bridgeobjects/tests/test_hands.py +0 -946
  28. bridgeobjects-0.1.30/bridgeobjects/tests/test_lin.py +0 -218
  29. bridgeobjects-0.1.30/bridgeobjects/tests/test_pbn.py +0 -233
  30. bridgeobjects-0.1.30/bridgeobjects/tests/test_rbn.py +0 -215
  31. bridgeobjects-0.1.30/bridgeobjects/tests/test_scores.py +0 -449
  32. bridgeobjects-0.1.30/bridgeobjects/tests/test_suits.py +0 -134
  33. bridgeobjects-0.1.30/bridgeobjects/tests/test_trick.py +0 -61
  34. bridgeobjects-0.1.30/bridgeobjects.egg-info/PKG-INFO +0 -368
  35. bridgeobjects-0.1.30/bridgeobjects.egg-info/SOURCES.txt +0 -51
  36. bridgeobjects-0.1.30/bridgeobjects.egg-info/dependency_links.txt +0 -1
  37. bridgeobjects-0.1.30/bridgeobjects.egg-info/top_level.txt +0 -1
  38. bridgeobjects-0.1.30/setup.cfg +0 -4
  39. bridgeobjects-0.1.30/setup.py +0 -57
  40. {bridgeobjects-0.1.30 → bridgeobjects-0.1.31}/LICENSE.txt +0 -0
  41. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/_create_pbn_string.py +0 -0
  42. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/_file_constants.py +0 -0
  43. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/_parse_pbn_string.py +0 -0
  44. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/_parse_rbn_string.py +0 -0
  45. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/auction.py +0 -0
  46. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/board.py +0 -0
  47. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/call.py +0 -0
  48. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/card.py +0 -0
  49. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/contract.py +0 -0
  50. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/denomination.py +0 -0
  51. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/event.py +0 -0
  52. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/file_operations.py +0 -0
  53. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/hand.py +0 -0
  54. {bridgeobjects-0.1.30 → bridgeobjects-0.1.31}/bridgeobjects/src/__init__.py +0 -0
  55. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/suit.py +0 -0
  56. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/suit_base.py +0 -0
  57. {bridgeobjects-0.1.30/bridgeobjects/src → bridgeobjects-0.1.31/bridgeobjects}/trick.py +0 -0
@@ -1,47 +1,10 @@
1
- Metadata-Version: 2.1
2
- Name: bridgeobjects
3
- Version: 0.1.30
4
- Summary: A collection of modules that allows the user to access objects used
5
- Home-page: https://psionman@bitbucket.org/psionman/bridgeobjects.git
6
- Download-URL: https://pypi.org/project/bridgeobjects/
7
- Author: jeff watkins
8
- Author-email: support@bidforgame.com
9
- License: MIT
10
- Keywords: bridge,duplicate bridge,contract bridge,hand,board,suit,auction,contract,card
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE.txt
13
-
14
- # bridgeobjects
15
- A collection of modules that allows the user to utilise objects used in bridge games, for example, a board or a contract.
16
-
17
- The classes form a natural hierarchy:
18
-
19
- event
20
- └── board
21
- ├── auction
22
- │   └── call
23
- │   └── denomination
24
- ├── contract
25
- ├── hand
26
- │   └── card
27
- │   └── suit
28
- └── trick
29
-
30
- (However, some classes are natural subsidiaries not represented in this classification, for example, there are four cards in a trick.)
31
-
32
-
33
- The objects can be created using a simple, self explanatory, human readable set of definitions
34
- by using Portable Bridge Notation (PBN) (http://www.tistis.nl/pbn/) or
35
- Richard’s Bridge Notation (RBN) (http://www.rpbridge.net/7a12.htm).
36
-
37
- ## Installation
38
- ```bash
39
- pip install bridgeobjects
40
- ```
1
+ # History
41
2
 
3
+ Version 0.1.32 - 21 July 2025
4
+
5
+ 1. Remove icecream
6
+ ------------------------------
42
7
 
43
- # History
44
- Version 0.1.30 0715 Apr 2024
45
8
 
46
9
  1. Initailse hand shape
47
10
 
@@ -366,3 +329,4 @@ Version 0.0.0 - August 2020
366
329
  Created and uploaded
367
330
 
368
331
  ---
332
+
@@ -0,0 +1,41 @@
1
+ Metadata-Version: 2.3
2
+ Name: bridgeobjects
3
+ Version: 0.1.31
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: jeffwatkins2000@gmail.com
7
+ Requires-Python: >=3.11
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Description-Content-Type: text/markdown
13
+
14
+ # bridgeobjects
15
+ A collection of modules that allows the user to utilise objects used in bridge games, for example, a board or a contract.
16
+
17
+ The classes form a natural hierarchy:
18
+
19
+ event
20
+ └── board
21
+ ├── auction
22
+ │   └── call
23
+ │   └── denomination
24
+ ├── contract
25
+ ├── hand
26
+ │   └── card
27
+ │   └── suit
28
+ └── trick
29
+
30
+ (However, some classes are natural subsidiaries not represented in this classification, for example, there are four cards in a trick.)
31
+
32
+
33
+ The objects can be created using a simple, self explanatory, human readable set of definitions
34
+ by using Portable Bridge Notation (PBN) (http://www.tistis.nl/pbn/) or
35
+ Richard’s Bridge Notation (RBN) (http://www.rpbridge.net/7a12.htm).
36
+
37
+ ## Installation
38
+ ```bash
39
+ pip install bridgeobjects
40
+ ```
41
+
@@ -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
 
@@ -17,22 +17,22 @@
17
17
  trick: four cards played which one pair wins:
18
18
  file_operations: a module to load or save events in a PBN, RBN or LIN format.
19
19
  """
20
- from icecream import ic, install
21
- ic.configureOutput(includeContext=True)
22
- install()
20
+ # from icecream import ic, install
21
+ # ic.configureOutput(includeContext=True)
22
+ # install()
23
23
 
24
- from bridgeobjects.src.constants import *
25
- from bridgeobjects.src.board import *
26
- from bridgeobjects.src.hand import *
27
- from bridgeobjects.src.card import *
28
- from bridgeobjects.src.suit import *
29
- from bridgeobjects.src.auction import *
30
- from bridgeobjects.src.contract import *
31
- from bridgeobjects.src.call import *
32
- from bridgeobjects.src.event import *
33
- from bridgeobjects.src.trick import *
34
- from bridgeobjects.src.file_operations import *
35
- from bridgeobjects.src.denomination import *
24
+ from bridgeobjects.constants import *
25
+ from bridgeobjects.board import *
26
+ from bridgeobjects.hand import *
27
+ from bridgeobjects.card import *
28
+ from bridgeobjects.suit import *
29
+ from bridgeobjects.auction import *
30
+ from bridgeobjects.contract import *
31
+ from bridgeobjects.call import *
32
+ from bridgeobjects.event import *
33
+ from bridgeobjects.trick import *
34
+ from bridgeobjects.file_operations import *
35
+ from bridgeobjects.denomination import *
36
36
 
37
37
  from ._version import __version__
38
38
  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
 
@@ -0,0 +1 @@
1
+ __version__ = '0.1.31'
@@ -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
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "python.linting.flake8Enabled": true,
3
+ "python.linting.enabled": true
4
+ }
@@ -0,0 +1,15 @@
1
+ [tool.poetry]
2
+ name = "bridgeobjects"
3
+ version = "0.1.31"
4
+ description = "A collection of modules that allows the user to utilise objects used in bridge games, for example, a board or a contract."
5
+ authors = ["Jeff <jeffwatkins2000@gmail.com>"]
6
+ readme = "README.md"
7
+ include = ["HISTORY.md"]
8
+
9
+
10
+ [tool.poetry.dependencies]
11
+ python = ">=3.11"
12
+
13
+ [build-system]
14
+ requires = ["poetry-core"]
15
+ build-backend = "poetry.core.masonry.api"
@@ -1 +0,0 @@
1
- __version__ = '0.1.30'
File without changes
@@ -1,97 +0,0 @@
1
- """A set of tests for the bridgeobjects Auction class."""
2
-
3
- import pytest
4
- from pathlib import Path
5
-
6
- from ..src.auction import Auction
7
- from ..src.call import Call
8
- from ..src.file_operations import load_pbn
9
-
10
- DATA_PATH = 'tests/test_data/'
11
- load_path = Path(DATA_PATH, 'pbn_auction_1.pbn')
12
- event = load_pbn(load_path)[0]
13
- test_auction = event.boards[0].auction
14
-
15
- """
16
- 1D 1S 3H =1= 4S
17
- 4NT =2= X Pass Pass
18
- 5C X 5H X
19
- Pass Pass Pass
20
-
21
- auction.calls = [
22
- Call('1D'), Call('1S'), Call('3H'), Call('4S'),
23
- Call('4NT'), Call('D'), Call('P'), Call('P'),
24
- Call('5C'), Call('D'), Call('5H'), Call('D'),
25
- Call('P'), Call('P'), Call('P'),
26
- ]
27
- """
28
-
29
-
30
- def test_first_caller_valid():
31
- """Test the first caller validation"""
32
- with pytest.raises(ValueError):
33
- Auction(first_caller='L')
34
-
35
-
36
- def test_calls_valid():
37
- """Test the call validation"""
38
- with pytest.raises(TypeError):
39
- auction = Auction(calls=3)
40
- with pytest.raises(ValueError):
41
- auction = Auction(calls=['0NT'])
42
- auction = Auction(calls=['1NT', 'P', 'P', 'P'])
43
- assert auction.calls == [Call('1NT'), Call('P'), Call('P'), Call('P')]
44
-
45
-
46
- def test_auction_caller():
47
- """Ensure that the auction caller is correct."""
48
- auction = Auction(first_caller='N')
49
- assert auction.first_caller == 'N'
50
-
51
-
52
- def test_auction_caller_assign():
53
- """Ensure that the auction caller assignment is correct."""
54
- auction = Auction()
55
- auction.first_caller = 'N'
56
- assert auction.first_caller == 'N'
57
-
58
-
59
- def test_auction_repr():
60
- """Ensure that the auction __repr__ is correct."""
61
- assert repr(test_auction) == 'Auction: 1D, 1S, 3H, 4S, 4NT, D, P, P, 5C, D, 5H, D, P, P, P'
62
-
63
-
64
- def test_auction_str():
65
- """Ensure that the auction __str__ is correct."""
66
- assert str(test_auction) == 'Auction: 1D, 1S, 3H, 4S, 4NT, D, P, P, 5C, D, 5H, D, P, P, P'
67
-
68
-
69
- def test_auction_note_keys():
70
- """Ensure that the auction note_keys is correct."""
71
- assert test_auction.note_keys == ['', '', '1', '', '2', '', '', '', '', '', '', '', '', '', '']
72
-
73
-
74
- def test_auction_note_key_validation():
75
- """Ensure that the auction note key setter is correct."""
76
- with pytest.raises(TypeError):
77
- auction = Auction()
78
- auction.note_keys = '1'
79
- with pytest.raises(TypeError):
80
- auction = Auction()
81
- auction.note_keys = [1, 2, 3]
82
-
83
-
84
- def test_auction_note_key_setter():
85
- """Ensure that the auction note key setter is correct."""
86
- auction = Auction()
87
- auction.note_keys = ['', '', '1', '']
88
- assert auction.note_keys == ['', '', '1', '']
89
-
90
-
91
- def test_auction_notes_setter():
92
- """Ensure that the auction notes setter is correct."""
93
- with pytest.raises(TypeError):
94
- auction = Auction()
95
- auction.notes = '1'
96
- auction = Auction()
97
- auction.notes = {'1': 'test note 1'}