corally 1.0.0__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.
- corally-1.0.0/LICENSE +21 -0
- corally-1.0.0/MANIFEST.in +38 -0
- corally-1.0.0/PKG-INFO +192 -0
- corally-1.0.0/README.md +140 -0
- corally-1.0.0/docs/QUICK_START_GUIDE.md +124 -0
- corally-1.0.0/docs/README.md +325 -0
- corally-1.0.0/pyproject.toml +99 -0
- corally-1.0.0/setup.cfg +4 -0
- corally-1.0.0/setup.py +91 -0
- corally-1.0.0/src/corally/__init__.py +36 -0
- corally-1.0.0/src/corally/api/__init__.py +8 -0
- corally-1.0.0/src/corally/api/free_server.py +259 -0
- corally-1.0.0/src/corally/api/server.py +190 -0
- corally-1.0.0/src/corally/cli/__init__.py +9 -0
- corally-1.0.0/src/corally/cli/calculator.py +59 -0
- corally-1.0.0/src/corally/cli/currency.py +65 -0
- corally-1.0.0/src/corally/cli/main.py +208 -0
- corally-1.0.0/src/corally/core/__init__.py +7 -0
- corally-1.0.0/src/corally/core/calculator.py +392 -0
- corally-1.0.0/src/corally/gui/__init__.py +8 -0
- corally-1.0.0/src/corally/gui/launcher.py +138 -0
- corally-1.0.0/src/corally/gui/main.py +886 -0
- corally-1.0.0/src/corally.egg-info/PKG-INFO +192 -0
- corally-1.0.0/src/corally.egg-info/SOURCES.txt +32 -0
- corally-1.0.0/src/corally.egg-info/dependency_links.txt +1 -0
- corally-1.0.0/src/corally.egg-info/entry_points.txt +5 -0
- corally-1.0.0/src/corally.egg-info/not-zip-safe +1 -0
- corally-1.0.0/src/corally.egg-info/requires.txt +17 -0
- corally-1.0.0/src/corally.egg-info/top_level.txt +1 -0
- corally-1.0.0/tests/test_api.py +227 -0
- corally-1.0.0/tests/test_gui.py +161 -0
- corally-1.0.0/tests/test_gui_api_connection.py +176 -0
- corally-1.0.0/tests/test_gui_simple.py +152 -0
- corally-1.0.0/tests/test_stop_button.py +137 -0
corally-1.0.0/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Corally Team
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Include documentation files
|
2
|
+
include README.md
|
3
|
+
include LICENSE
|
4
|
+
include CHANGELOG.md
|
5
|
+
|
6
|
+
# Include configuration files
|
7
|
+
include pyproject.toml
|
8
|
+
include setup.py
|
9
|
+
|
10
|
+
# Include documentation directory
|
11
|
+
recursive-include docs *.md *.txt *.rst
|
12
|
+
|
13
|
+
# Include test files
|
14
|
+
recursive-include tests *.py
|
15
|
+
|
16
|
+
# Include data files
|
17
|
+
recursive-include src/corally *.txt *.csv *.json
|
18
|
+
|
19
|
+
# Exclude compiled Python files
|
20
|
+
global-exclude *.pyc
|
21
|
+
global-exclude *.pyo
|
22
|
+
global-exclude *.pyd
|
23
|
+
global-exclude __pycache__
|
24
|
+
global-exclude .git*
|
25
|
+
global-exclude .DS_Store
|
26
|
+
|
27
|
+
# Exclude development files
|
28
|
+
exclude .gitignore
|
29
|
+
exclude .env
|
30
|
+
exclude .env.example
|
31
|
+
exclude tox.ini
|
32
|
+
exclude .coverage
|
33
|
+
exclude .pytest_cache
|
34
|
+
|
35
|
+
# Exclude build artifacts
|
36
|
+
exclude build
|
37
|
+
exclude dist
|
38
|
+
exclude *.egg-info
|
corally-1.0.0/PKG-INFO
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: corally
|
3
|
+
Version: 1.0.0
|
4
|
+
Summary: A comprehensive calculator suite with GUI and API support
|
5
|
+
Home-page: https://github.com/yourusername/corally
|
6
|
+
Author: Corally Team
|
7
|
+
Author-email: Corally Team <fleermaxim@gmail.com>
|
8
|
+
License: MIT
|
9
|
+
Project-URL: Homepage, https://github.com/mephisto-007
|
10
|
+
Project-URL: Documentation, https://github.com/mephisto-007/corally#readme
|
11
|
+
Project-URL: Repository, https://github.com/mephisto-007/Corally
|
12
|
+
Project-URL: Bug Tracker, https://github.com/mephisto-007/corally/issues
|
13
|
+
Keywords: calculator,currency,converter,interest,gui,api,finance,math,tkinter,fastapi
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
15
|
+
Classifier: Intended Audience :: Developers
|
16
|
+
Classifier: Intended Audience :: Education
|
17
|
+
Classifier: Intended Audience :: End Users/Desktop
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
19
|
+
Classifier: Operating System :: OS Independent
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
26
|
+
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
28
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
29
|
+
Classifier: Topic :: Utilities
|
30
|
+
Requires-Python: >=3.8
|
31
|
+
Description-Content-Type: text/markdown
|
32
|
+
License-File: LICENSE
|
33
|
+
Requires-Dist: fastapi>=0.68.0
|
34
|
+
Requires-Dist: uvicorn>=0.15.0
|
35
|
+
Requires-Dist: httpx>=0.24.0
|
36
|
+
Requires-Dist: requests>=2.25.0
|
37
|
+
Requires-Dist: python-dotenv>=0.19.0
|
38
|
+
Provides-Extra: gui
|
39
|
+
Requires-Dist: tkinter; extra == "gui"
|
40
|
+
Provides-Extra: dev
|
41
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
42
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
43
|
+
Requires-Dist: black; extra == "dev"
|
44
|
+
Requires-Dist: flake8; extra == "dev"
|
45
|
+
Requires-Dist: mypy; extra == "dev"
|
46
|
+
Requires-Dist: build; extra == "dev"
|
47
|
+
Requires-Dist: twine; extra == "dev"
|
48
|
+
Dynamic: author
|
49
|
+
Dynamic: home-page
|
50
|
+
Dynamic: license-file
|
51
|
+
Dynamic: requires-python
|
52
|
+
|
53
|
+
# ๐งฎ Corally Calculator Suite
|
54
|
+
|
55
|
+
[](https://badge.fury.io/py/corally)
|
56
|
+
[](https://www.python.org/downloads/)
|
57
|
+
[](https://opensource.org/licenses/MIT)
|
58
|
+
|
59
|
+
A comprehensive Python calculator suite with modern GUI, CLI tools, and API servers. Features live currency conversion, interest calculations, and automatic operation logging.
|
60
|
+
|
61
|
+
## โจ Features
|
62
|
+
|
63
|
+
- **๐งฎ Basic Calculator** - Four operations with automatic CSV logging
|
64
|
+
- **๐ฑ Currency Converter** - Static rates + live API integration (150+ currencies)
|
65
|
+
- **๐ Interest Calculator** - Multiple methods (30/360, act/360, act/365, act/act)
|
66
|
+
- **๐จ Modern GUI** - Dark theme with tabbed interface
|
67
|
+
- **๐ Live API** - Free & paid currency APIs with caching
|
68
|
+
- **๐ Auto Logging** - All operations saved to CSV files
|
69
|
+
- **๐ฅ๏ธ Multiple Interfaces** - GUI, CLI, and API access
|
70
|
+
|
71
|
+
## ๐ Quick Start
|
72
|
+
|
73
|
+
### Installation from PyPI
|
74
|
+
```bash
|
75
|
+
pip install corally
|
76
|
+
```
|
77
|
+
|
78
|
+
### Command Line Usage
|
79
|
+
```bash
|
80
|
+
# Main calculator suite
|
81
|
+
corally
|
82
|
+
|
83
|
+
# Individual tools
|
84
|
+
corally-calc # Basic calculator
|
85
|
+
corally-currency # Currency converter
|
86
|
+
corally-gui # Launch GUI interface
|
87
|
+
```
|
88
|
+
|
89
|
+
### Python Package Usage
|
90
|
+
```python
|
91
|
+
from corally import CalculatorCore, CurrencyConverter, InterestCalculator
|
92
|
+
|
93
|
+
# Basic calculator
|
94
|
+
calc = CalculatorCore()
|
95
|
+
result = calc.add(10, 5) # Returns 15.0
|
96
|
+
|
97
|
+
# Currency conversion (static rates)
|
98
|
+
converter = CurrencyConverter()
|
99
|
+
usd_amount = converter.eur_to_usd(100)
|
100
|
+
|
101
|
+
# Interest calculation
|
102
|
+
interest_calc = InterestCalculator()
|
103
|
+
interest = interest_calc.calculate_interest(
|
104
|
+
principal=1000,
|
105
|
+
rate=5.0,
|
106
|
+
days=30,
|
107
|
+
method="30/360"
|
108
|
+
)
|
109
|
+
```
|
110
|
+
|
111
|
+
## ๐ Project Structure
|
112
|
+
|
113
|
+
```
|
114
|
+
Calculator Suite/
|
115
|
+
โโโ ๐ฑ Core Applications
|
116
|
+
โ โโโ calculator_core.py # Unified core library
|
117
|
+
โ โโโ calculator_gui.py # Modern GUI application
|
118
|
+
โ โโโ gui_launcher.py # GUI launcher
|
119
|
+
โ โโโ Hauptprogramm.py # Console menu
|
120
|
+
โ โโโ Rechner.py # Console calculator
|
121
|
+
โ โโโ Waerungsrechner.py # Console currency converter
|
122
|
+
โ โโโ api.py # Paid API server
|
123
|
+
โ โโโ api_free.py # Free API server
|
124
|
+
โ โโโ manage_api_server.py # API management
|
125
|
+
โ โโโ requirements.txt # Dependencies
|
126
|
+
โ
|
127
|
+
โโโ ๐ data/ # Generated data files
|
128
|
+
โ โโโ rechner_log.csv # Calculator operation logs
|
129
|
+
โ โโโ cache.csv # API response cache
|
130
|
+
โ โโโ api.log # Server logs
|
131
|
+
โ
|
132
|
+
โโโ ๐ docs/ # Documentation
|
133
|
+
โ โโโ README.md # Full documentation
|
134
|
+
โ โโโ QUICK_START_GUIDE.md # Quick setup guide
|
135
|
+
โ
|
136
|
+
โโโ ๐งช tests/ # Test files
|
137
|
+
โ โโโ test_api.py
|
138
|
+
โ โโโ test_gui.py
|
139
|
+
โ โโโ test_*.py
|
140
|
+
โ
|
141
|
+
โโโ ๐ง debug/ # Debug & development tools
|
142
|
+
โ โโโ debug_*.py
|
143
|
+
โ โโโ fix_*.py
|
144
|
+
โ
|
145
|
+
โโโ ๐ misc_files/ # Miscellaneous files
|
146
|
+
โโโ launch_calculator.bat
|
147
|
+
โโโ RockYourBody.py
|
148
|
+
โโโ *.pptx
|
149
|
+
```
|
150
|
+
|
151
|
+
## โจ Features
|
152
|
+
|
153
|
+
- **๐งฎ Basic Calculator** - Four operations with automatic logging
|
154
|
+
- **๐ฑ Currency Converter** - Static + live rates (150+ currencies)
|
155
|
+
- **๐ Interest Calculator** - Multiple calculation methods
|
156
|
+
- **๐จ Modern GUI** - Dark theme with tabbed interface
|
157
|
+
- **๐ Live API** - Free & paid currency conversion
|
158
|
+
- **๐ Auto Logging** - All operations saved to CSV
|
159
|
+
|
160
|
+
## ๐ฆ Installation
|
161
|
+
|
162
|
+
```bash
|
163
|
+
pip install -r requirements.txt
|
164
|
+
```
|
165
|
+
|
166
|
+
## ๐ง Configuration
|
167
|
+
|
168
|
+
For live currency conversion, create `.env` file:
|
169
|
+
```env
|
170
|
+
API_KEY=your_api_key_here
|
171
|
+
```
|
172
|
+
|
173
|
+
## ๐ Documentation
|
174
|
+
|
175
|
+
- **Full Documentation**: `docs/README.md`
|
176
|
+
- **Quick Start Guide**: `docs/QUICK_START_GUIDE.md`
|
177
|
+
|
178
|
+
## ๐งช Testing
|
179
|
+
|
180
|
+
Run tests from the tests/ directory:
|
181
|
+
```bash
|
182
|
+
python tests/test_gui.py
|
183
|
+
python tests/test_api.py
|
184
|
+
```
|
185
|
+
|
186
|
+
## ๐ ๏ธ Development
|
187
|
+
|
188
|
+
Debug tools are available in the debug/ directory for troubleshooting and development.
|
189
|
+
|
190
|
+
---
|
191
|
+
|
192
|
+
**Version**: 2.0 | **Python**: 3.8+ | **License**: Educational Use
|
corally-1.0.0/README.md
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
# ๐งฎ Corally Calculator Suite
|
2
|
+
|
3
|
+
[](https://badge.fury.io/py/corally)
|
4
|
+
[](https://www.python.org/downloads/)
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
6
|
+
|
7
|
+
A comprehensive Python calculator suite with modern GUI, CLI tools, and API servers. Features live currency conversion, interest calculations, and automatic operation logging.
|
8
|
+
|
9
|
+
## โจ Features
|
10
|
+
|
11
|
+
- **๐งฎ Basic Calculator** - Four operations with automatic CSV logging
|
12
|
+
- **๐ฑ Currency Converter** - Static rates + live API integration (150+ currencies)
|
13
|
+
- **๐ Interest Calculator** - Multiple methods (30/360, act/360, act/365, act/act)
|
14
|
+
- **๐จ Modern GUI** - Dark theme with tabbed interface
|
15
|
+
- **๐ Live API** - Free & paid currency APIs with caching
|
16
|
+
- **๐ Auto Logging** - All operations saved to CSV files
|
17
|
+
- **๐ฅ๏ธ Multiple Interfaces** - GUI, CLI, and API access
|
18
|
+
|
19
|
+
## ๐ Quick Start
|
20
|
+
|
21
|
+
### Installation from PyPI
|
22
|
+
```bash
|
23
|
+
pip install corally
|
24
|
+
```
|
25
|
+
|
26
|
+
### Command Line Usage
|
27
|
+
```bash
|
28
|
+
# Main calculator suite
|
29
|
+
corally
|
30
|
+
|
31
|
+
# Individual tools
|
32
|
+
corally-calc # Basic calculator
|
33
|
+
corally-currency # Currency converter
|
34
|
+
corally-gui # Launch GUI interface
|
35
|
+
```
|
36
|
+
|
37
|
+
### Python Package Usage
|
38
|
+
```python
|
39
|
+
from corally import CalculatorCore, CurrencyConverter, InterestCalculator
|
40
|
+
|
41
|
+
# Basic calculator
|
42
|
+
calc = CalculatorCore()
|
43
|
+
result = calc.add(10, 5) # Returns 15.0
|
44
|
+
|
45
|
+
# Currency conversion (static rates)
|
46
|
+
converter = CurrencyConverter()
|
47
|
+
usd_amount = converter.eur_to_usd(100)
|
48
|
+
|
49
|
+
# Interest calculation
|
50
|
+
interest_calc = InterestCalculator()
|
51
|
+
interest = interest_calc.calculate_interest(
|
52
|
+
principal=1000,
|
53
|
+
rate=5.0,
|
54
|
+
days=30,
|
55
|
+
method="30/360"
|
56
|
+
)
|
57
|
+
```
|
58
|
+
|
59
|
+
## ๐ Project Structure
|
60
|
+
|
61
|
+
```
|
62
|
+
Calculator Suite/
|
63
|
+
โโโ ๐ฑ Core Applications
|
64
|
+
โ โโโ calculator_core.py # Unified core library
|
65
|
+
โ โโโ calculator_gui.py # Modern GUI application
|
66
|
+
โ โโโ gui_launcher.py # GUI launcher
|
67
|
+
โ โโโ Hauptprogramm.py # Console menu
|
68
|
+
โ โโโ Rechner.py # Console calculator
|
69
|
+
โ โโโ Waerungsrechner.py # Console currency converter
|
70
|
+
โ โโโ api.py # Paid API server
|
71
|
+
โ โโโ api_free.py # Free API server
|
72
|
+
โ โโโ manage_api_server.py # API management
|
73
|
+
โ โโโ requirements.txt # Dependencies
|
74
|
+
โ
|
75
|
+
โโโ ๐ data/ # Generated data files
|
76
|
+
โ โโโ rechner_log.csv # Calculator operation logs
|
77
|
+
โ โโโ cache.csv # API response cache
|
78
|
+
โ โโโ api.log # Server logs
|
79
|
+
โ
|
80
|
+
โโโ ๐ docs/ # Documentation
|
81
|
+
โ โโโ README.md # Full documentation
|
82
|
+
โ โโโ QUICK_START_GUIDE.md # Quick setup guide
|
83
|
+
โ
|
84
|
+
โโโ ๐งช tests/ # Test files
|
85
|
+
โ โโโ test_api.py
|
86
|
+
โ โโโ test_gui.py
|
87
|
+
โ โโโ test_*.py
|
88
|
+
โ
|
89
|
+
โโโ ๐ง debug/ # Debug & development tools
|
90
|
+
โ โโโ debug_*.py
|
91
|
+
โ โโโ fix_*.py
|
92
|
+
โ
|
93
|
+
โโโ ๐ misc_files/ # Miscellaneous files
|
94
|
+
โโโ launch_calculator.bat
|
95
|
+
โโโ RockYourBody.py
|
96
|
+
โโโ *.pptx
|
97
|
+
```
|
98
|
+
|
99
|
+
## โจ Features
|
100
|
+
|
101
|
+
- **๐งฎ Basic Calculator** - Four operations with automatic logging
|
102
|
+
- **๐ฑ Currency Converter** - Static + live rates (150+ currencies)
|
103
|
+
- **๐ Interest Calculator** - Multiple calculation methods
|
104
|
+
- **๐จ Modern GUI** - Dark theme with tabbed interface
|
105
|
+
- **๐ Live API** - Free & paid currency conversion
|
106
|
+
- **๐ Auto Logging** - All operations saved to CSV
|
107
|
+
|
108
|
+
## ๐ฆ Installation
|
109
|
+
|
110
|
+
```bash
|
111
|
+
pip install -r requirements.txt
|
112
|
+
```
|
113
|
+
|
114
|
+
## ๐ง Configuration
|
115
|
+
|
116
|
+
For live currency conversion, create `.env` file:
|
117
|
+
```env
|
118
|
+
API_KEY=your_api_key_here
|
119
|
+
```
|
120
|
+
|
121
|
+
## ๐ Documentation
|
122
|
+
|
123
|
+
- **Full Documentation**: `docs/README.md`
|
124
|
+
- **Quick Start Guide**: `docs/QUICK_START_GUIDE.md`
|
125
|
+
|
126
|
+
## ๐งช Testing
|
127
|
+
|
128
|
+
Run tests from the tests/ directory:
|
129
|
+
```bash
|
130
|
+
python tests/test_gui.py
|
131
|
+
python tests/test_api.py
|
132
|
+
```
|
133
|
+
|
134
|
+
## ๐ ๏ธ Development
|
135
|
+
|
136
|
+
Debug tools are available in the debug/ directory for troubleshooting and development.
|
137
|
+
|
138
|
+
---
|
139
|
+
|
140
|
+
**Version**: 2.0 | **Python**: 3.8+ | **License**: Educational Use
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# ๐ Quick Start Guide - Live Currency API
|
2
|
+
|
3
|
+
## Option 1: Free API (Recommended) โญ
|
4
|
+
|
5
|
+
**No API key required - works immediately!**
|
6
|
+
|
7
|
+
### Steps:
|
8
|
+
1. **Launch the GUI:**
|
9
|
+
```bash
|
10
|
+
python gui_launcher.py
|
11
|
+
```
|
12
|
+
|
13
|
+
2. **Go to the "Live Currency API" tab**
|
14
|
+
|
15
|
+
3. **Select "Free API (No key required)" radio button**
|
16
|
+
|
17
|
+
4. **Click "Start API Server"**
|
18
|
+
- Wait for status to show "Running (Free API)"
|
19
|
+
|
20
|
+
5. **Test the conversion:**
|
21
|
+
- From Currency: `EUR`
|
22
|
+
- To Currency: `USD`
|
23
|
+
- Amount: `100`
|
24
|
+
- Click "Convert Currency"
|
25
|
+
|
26
|
+
### If the Free API doesn't start:
|
27
|
+
Try starting it manually first:
|
28
|
+
```bash
|
29
|
+
uvicorn api_free:app --host 127.0.0.1 --port 8000
|
30
|
+
```
|
31
|
+
|
32
|
+
Then in another terminal, test it:
|
33
|
+
```bash
|
34
|
+
curl "http://127.0.0.1:8000/convert?from_currency=EUR&to_currency=USD&amount=100"
|
35
|
+
```
|
36
|
+
|
37
|
+
## Option 2: Paid API (Requires API Key)
|
38
|
+
|
39
|
+
### Steps:
|
40
|
+
1. **Get a free API key from:**
|
41
|
+
- https://exchangerate.host/ (Free, no registration)
|
42
|
+
- https://fixer.io/ (Free tier available)
|
43
|
+
- https://exchangeratesapi.io/ (Free tier available)
|
44
|
+
|
45
|
+
2. **Create a `.env` file in your Calculator folder:**
|
46
|
+
```
|
47
|
+
API_KEY=your_actual_api_key_here
|
48
|
+
```
|
49
|
+
|
50
|
+
3. **In the GUI:**
|
51
|
+
- Select "Paid API (Requires .env file)"
|
52
|
+
- Click "Start API Server"
|
53
|
+
|
54
|
+
## Troubleshooting ๐ง
|
55
|
+
|
56
|
+
### Problem: "Failed to start server"
|
57
|
+
**Solution:** Check if port 8000 is already in use
|
58
|
+
```bash
|
59
|
+
netstat -an | findstr :8000
|
60
|
+
```
|
61
|
+
|
62
|
+
If something is using port 8000, either:
|
63
|
+
- Stop that service, or
|
64
|
+
- Modify the port in the GUI code
|
65
|
+
|
66
|
+
### Problem: "Network error" or "API request failed"
|
67
|
+
**Solutions:**
|
68
|
+
1. **Check internet connection**
|
69
|
+
2. **Try the Free API mode first**
|
70
|
+
3. **Check Windows Firewall** - make sure Python is allowed
|
71
|
+
|
72
|
+
### Problem: "Missing dependencies"
|
73
|
+
**Solution:** Install required packages
|
74
|
+
```bash
|
75
|
+
pip install fastapi uvicorn httpx requests dotenv
|
76
|
+
```
|
77
|
+
|
78
|
+
## Testing the API Manually ๐งช
|
79
|
+
|
80
|
+
### Test Free API directly:
|
81
|
+
```bash
|
82
|
+
python -c "
|
83
|
+
import requests
|
84
|
+
response = requests.get('https://api.exchangerate-api.com/v4/latest/EUR')
|
85
|
+
print(response.json()['rates']['USD'])
|
86
|
+
"
|
87
|
+
```
|
88
|
+
|
89
|
+
### Test Local Server:
|
90
|
+
1. Start server: `uvicorn api_free:app --port 8000`
|
91
|
+
2. Open browser: `http://127.0.0.1:8000`
|
92
|
+
3. Test conversion: `http://127.0.0.1:8000/convert?from_currency=EUR&to_currency=USD&amount=100`
|
93
|
+
|
94
|
+
## Success Indicators โ
|
95
|
+
|
96
|
+
When working correctly, you should see:
|
97
|
+
- โ
Server status: "Running (Free API)" or "Running (Paid API)"
|
98
|
+
- โ
Conversion results showing in the text area
|
99
|
+
- โ
Exchange rates and amounts displayed
|
100
|
+
- โ
"Cached" or "Live" status for each conversion
|
101
|
+
|
102
|
+
## Example Working Output:
|
103
|
+
```
|
104
|
+
๐ Live Currency Conversion:
|
105
|
+
100.0 EUR = 108.50 USD
|
106
|
+
Exchange Rate: 1.0850
|
107
|
+
----------------------------------------
|
108
|
+
```
|
109
|
+
|
110
|
+
## Still Having Issues? ๐
|
111
|
+
|
112
|
+
1. **Check the terminal/console** where you started the GUI for error messages
|
113
|
+
2. **Try the basic calculator and currency converter tabs first** - they should work perfectly
|
114
|
+
3. **The static currency converter** (tab 2) works without any API and gives you currency conversion
|
115
|
+
4. **Contact me** if you need help - I can help debug specific error messages
|
116
|
+
|
117
|
+
## Pro Tips ๐ก
|
118
|
+
|
119
|
+
1. **Start with Free API** - it's more reliable and doesn't need setup
|
120
|
+
2. **The GUI saves your calculations** - check the CSV files for history
|
121
|
+
3. **You can use both APIs** - switch between them as needed
|
122
|
+
4. **Cache system** - repeated conversions are faster (cached for 1 hour)
|
123
|
+
|
124
|
+
Your Calculator Suite is fully functional - the Live API is just an extra feature! ๐ฏ
|