prop-cli 1.0.0__tar.gz → 1.0.1__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.
- prop_cli-1.0.1/PKG-INFO +134 -0
- prop_cli-1.0.1/prop_cli.egg-info/PKG-INFO +134 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/pyproject.toml +3 -2
- prop_cli-1.0.0/PKG-INFO +0 -10
- prop_cli-1.0.0/prop_cli.egg-info/PKG-INFO +0 -10
- {prop_cli-1.0.0 → prop_cli-1.0.1}/LICENSE +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/README.md +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/prop_cli.egg-info/SOURCES.txt +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/prop_cli.egg-info/dependency_links.txt +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/prop_cli.egg-info/entry_points.txt +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/prop_cli.egg-info/top_level.txt +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/proportion_calculator/__init__.py +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/proportion_calculator/cli.py +0 -0
- {prop_cli-1.0.0 → prop_cli-1.0.1}/setup.cfg +0 -0
prop_cli-1.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prop-cli
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: A command-line tool to solve proportions using the rule of three
|
|
5
|
+
Author-email: "Domenico Bruno \"Lobkowitz\"" <blobkowitz@gmail.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Requires-Python: >=3.6
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# prop-cli
|
|
14
|
+
|
|
15
|
+
A simple command-line tool that solves proportions of the form:
|
|
16
|
+
|
|
17
|
+
a : b = c : d
|
|
18
|
+
|
|
19
|
+
where one of the terms is unknown (`x`).
|
|
20
|
+
This is the classic **rule of three**, a fundamental arithmetic technique for solving proportions by cross-multiplication.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Clone the repository and install locally:
|
|
27
|
+
|
|
28
|
+
pip install .
|
|
29
|
+
|
|
30
|
+
This will install the `prop-cli` command.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
prop-cli <a> <b> <c> <d>
|
|
37
|
+
|
|
38
|
+
Example:
|
|
39
|
+
|
|
40
|
+
prop-cli 10 12 x 30
|
|
41
|
+
|
|
42
|
+
Output:
|
|
43
|
+
|
|
44
|
+
Proportion: 10:12 = 25:30
|
|
45
|
+
x = 25
|
|
46
|
+
|
|
47
|
+
You can put `x` in any of the four positions:
|
|
48
|
+
|
|
49
|
+
prop-cli x 5 6 12
|
|
50
|
+
prop-cli 2 x 4 8
|
|
51
|
+
prop-cli 3 9 x 27
|
|
52
|
+
prop-cli 4 5 0.1 x
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## How cross-multiplication works
|
|
57
|
+
|
|
58
|
+
To solve a proportion of the form:
|
|
59
|
+
|
|
60
|
+
a : b = c : d
|
|
61
|
+
|
|
62
|
+
we use **cross-multiplication**, which states that:
|
|
63
|
+
|
|
64
|
+
a × d = b × c
|
|
65
|
+
|
|
66
|
+
This is the fundamental property of proportions.
|
|
67
|
+
|
|
68
|
+
### Visual ASCII diagram
|
|
69
|
+
|
|
70
|
+
a : b = c : d
|
|
71
|
+
│ │
|
|
72
|
+
│ │
|
|
73
|
+
└───┬───┘
|
|
74
|
+
│
|
|
75
|
+
Cross-multiplication
|
|
76
|
+
│
|
|
77
|
+
a × d = b × c
|
|
78
|
+
|
|
79
|
+
### Solving for an unknown (example)
|
|
80
|
+
|
|
81
|
+
If one term is unknown (`x`), we isolate it using the cross-multiplication identity.
|
|
82
|
+
|
|
83
|
+
Case: the unknown is in the second position (`x`):
|
|
84
|
+
|
|
85
|
+
a : x = c : d
|
|
86
|
+
│ │
|
|
87
|
+
│ │
|
|
88
|
+
└───┬───┘
|
|
89
|
+
│
|
|
90
|
+
a × d = x × c
|
|
91
|
+
│
|
|
92
|
+
└──→ x = (a × d) / c
|
|
93
|
+
|
|
94
|
+
Another case: unknown in the fourth position (`x`):
|
|
95
|
+
|
|
96
|
+
a : b = c : x
|
|
97
|
+
│ │
|
|
98
|
+
│ │
|
|
99
|
+
└───┬───┘
|
|
100
|
+
│
|
|
101
|
+
a × x = b × c
|
|
102
|
+
│
|
|
103
|
+
└──→ x = (b × c) / a
|
|
104
|
+
|
|
105
|
+
This tool automatically:
|
|
106
|
+
- identifies where the `x` is,
|
|
107
|
+
- applies the correct formula,
|
|
108
|
+
- prints the solved proportion and the computed value.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Error handling
|
|
113
|
+
|
|
114
|
+
The tool validates:
|
|
115
|
+
- only one unknown term (`x`)
|
|
116
|
+
- all other terms must be valid numbers
|
|
117
|
+
- division by zero is caught with clear error messages
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Project structure
|
|
122
|
+
|
|
123
|
+
prop-cli/
|
|
124
|
+
├── pyproject.toml
|
|
125
|
+
├── README.md
|
|
126
|
+
└── proportion_calculator/
|
|
127
|
+
├── cli.py
|
|
128
|
+
└── __init__.py
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT License
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prop-cli
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: A command-line tool to solve proportions using the rule of three
|
|
5
|
+
Author-email: "Domenico Bruno \"Lobkowitz\"" <blobkowitz@gmail.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Requires-Python: >=3.6
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# prop-cli
|
|
14
|
+
|
|
15
|
+
A simple command-line tool that solves proportions of the form:
|
|
16
|
+
|
|
17
|
+
a : b = c : d
|
|
18
|
+
|
|
19
|
+
where one of the terms is unknown (`x`).
|
|
20
|
+
This is the classic **rule of three**, a fundamental arithmetic technique for solving proportions by cross-multiplication.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Clone the repository and install locally:
|
|
27
|
+
|
|
28
|
+
pip install .
|
|
29
|
+
|
|
30
|
+
This will install the `prop-cli` command.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
prop-cli <a> <b> <c> <d>
|
|
37
|
+
|
|
38
|
+
Example:
|
|
39
|
+
|
|
40
|
+
prop-cli 10 12 x 30
|
|
41
|
+
|
|
42
|
+
Output:
|
|
43
|
+
|
|
44
|
+
Proportion: 10:12 = 25:30
|
|
45
|
+
x = 25
|
|
46
|
+
|
|
47
|
+
You can put `x` in any of the four positions:
|
|
48
|
+
|
|
49
|
+
prop-cli x 5 6 12
|
|
50
|
+
prop-cli 2 x 4 8
|
|
51
|
+
prop-cli 3 9 x 27
|
|
52
|
+
prop-cli 4 5 0.1 x
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## How cross-multiplication works
|
|
57
|
+
|
|
58
|
+
To solve a proportion of the form:
|
|
59
|
+
|
|
60
|
+
a : b = c : d
|
|
61
|
+
|
|
62
|
+
we use **cross-multiplication**, which states that:
|
|
63
|
+
|
|
64
|
+
a × d = b × c
|
|
65
|
+
|
|
66
|
+
This is the fundamental property of proportions.
|
|
67
|
+
|
|
68
|
+
### Visual ASCII diagram
|
|
69
|
+
|
|
70
|
+
a : b = c : d
|
|
71
|
+
│ │
|
|
72
|
+
│ │
|
|
73
|
+
└───┬───┘
|
|
74
|
+
│
|
|
75
|
+
Cross-multiplication
|
|
76
|
+
│
|
|
77
|
+
a × d = b × c
|
|
78
|
+
|
|
79
|
+
### Solving for an unknown (example)
|
|
80
|
+
|
|
81
|
+
If one term is unknown (`x`), we isolate it using the cross-multiplication identity.
|
|
82
|
+
|
|
83
|
+
Case: the unknown is in the second position (`x`):
|
|
84
|
+
|
|
85
|
+
a : x = c : d
|
|
86
|
+
│ │
|
|
87
|
+
│ │
|
|
88
|
+
└───┬───┘
|
|
89
|
+
│
|
|
90
|
+
a × d = x × c
|
|
91
|
+
│
|
|
92
|
+
└──→ x = (a × d) / c
|
|
93
|
+
|
|
94
|
+
Another case: unknown in the fourth position (`x`):
|
|
95
|
+
|
|
96
|
+
a : b = c : x
|
|
97
|
+
│ │
|
|
98
|
+
│ │
|
|
99
|
+
└───┬───┘
|
|
100
|
+
│
|
|
101
|
+
a × x = b × c
|
|
102
|
+
│
|
|
103
|
+
└──→ x = (b × c) / a
|
|
104
|
+
|
|
105
|
+
This tool automatically:
|
|
106
|
+
- identifies where the `x` is,
|
|
107
|
+
- applies the correct formula,
|
|
108
|
+
- prints the solved proportion and the computed value.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Error handling
|
|
113
|
+
|
|
114
|
+
The tool validates:
|
|
115
|
+
- only one unknown term (`x`)
|
|
116
|
+
- all other terms must be valid numbers
|
|
117
|
+
- division by zero is caught with clear error messages
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Project structure
|
|
122
|
+
|
|
123
|
+
prop-cli/
|
|
124
|
+
├── pyproject.toml
|
|
125
|
+
├── README.md
|
|
126
|
+
└── proportion_calculator/
|
|
127
|
+
├── cli.py
|
|
128
|
+
└── __init__.py
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT License
|
|
@@ -4,8 +4,9 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "prop-cli"
|
|
7
|
-
version = "1.0.
|
|
8
|
-
description = "A
|
|
7
|
+
version = "1.0.1"
|
|
8
|
+
description = "A command-line tool to solve proportions using the rule of three"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
authors = [
|
|
10
11
|
{ name = "Domenico Bruno \"Lobkowitz\"", email = "blobkowitz@gmail.com" }
|
|
11
12
|
]
|
prop_cli-1.0.0/PKG-INFO
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: prop-cli
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: A simple command-line proportion solver (rule of three)
|
|
5
|
-
Author-email: "Domenico Bruno \"Lobkowitz\"" <blobkowitz@gmail.com>
|
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
|
7
|
-
Classifier: Operating System :: OS Independent
|
|
8
|
-
Requires-Python: >=3.6
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Dynamic: license-file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: prop-cli
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: A simple command-line proportion solver (rule of three)
|
|
5
|
-
Author-email: "Domenico Bruno \"Lobkowitz\"" <blobkowitz@gmail.com>
|
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
|
7
|
-
Classifier: Operating System :: OS Independent
|
|
8
|
-
Requires-Python: >=3.6
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|