financegy 1.5__py3-none-any.whl → 3.0__py3-none-any.whl

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.
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: financegy
3
+ Version: 3.0
4
+ Summary: Unofficial Python library for accessing GSE (Guyana Stock Exchange) financial data
5
+ Author-email: Ezra Minty <ezranminty@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/xbze3/financegy
8
+ Project-URL: Issues, https://github.com/xbze3/financegy/issues
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: requests
12
+ Requires-Dist: beautifulsoup4
13
+ Requires-Dist: pandas
14
+ Requires-Dist: openpyxl
15
+ Dynamic: license-file
16
+
17
+ # 🏦 FinanceGY
18
+
19
+ **FinanceGY** is an unofficial Python library for accessing financial data from the **Guyana Stock Exchange (GSE)**. It provides a simple and consistent interface for retrieving information on traded securities, recent trade data, and session details, all programmatically.
20
+
21
+ ---
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ pip install financegy
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Quick Start
32
+
33
+ ```python
34
+ import financegy
35
+
36
+ # --------------------------
37
+ # Core Data Retrieval
38
+ # --------------------------
39
+
40
+ # Get a list of all traded securities
41
+ securities = financegy.get_securities()
42
+
43
+ # Get the full name of a security by its ticker symbol
44
+ security_name = financegy.get_security_by_symbol("DDL")
45
+
46
+ # Get the most recent trade data for a security
47
+ recent_trade = financegy.get_recent_trade("DDL")
48
+
49
+ # Get the most recent closing/last trade price (same most-recent session)
50
+ previous_close = financegy.get_previous_close("DDL")
51
+
52
+ # Get absolute price change vs previous session close
53
+ price_change = financegy.get_price_change("DDL")
54
+
55
+ # Get percent price change vs previous session close
56
+ price_change_percent = financegy.get_price_change_percent("DDL")
57
+
58
+ # Get all trade data for the most recent year (for the security)
59
+ recent_year_trades = financegy.get_security_recent_year("DDL")
60
+
61
+ # Get trade data for a specific trading session (all securities)
62
+ session_trades = financegy.get_session_trades("1136")
63
+
64
+ # Get trade data for a specific security in a session
65
+ security_session_trade = financegy.get_security_session_trade("DDL", "1136")
66
+
67
+ # Search for securities by name or symbol
68
+ search_results = financegy.search_securities("DDL")
69
+
70
+ # Get all trades for a specific year
71
+ year_trades = financegy.get_trades_for_year("DDL", "2019")
72
+
73
+ # Get historical trades within a date range — supports: yyyy / mm/yyyy / dd/mm/yyyy
74
+ historical_trades = financegy.get_historical_trades(
75
+ symbol="DDL",
76
+ start_date="01/06/2020",
77
+ end_date="01/2022"
78
+ )
79
+
80
+ # --------------------------
81
+ # Analytics / Calculations
82
+ # --------------------------
83
+
84
+ # Get the latest session info (dict returned from most recent trade)
85
+ latest_session = financegy.get_latest_session_for_symbol("DDL")
86
+
87
+ # Average last traded price over a session range (inclusive)
88
+ avg_price_range = financegy.get_sessions_average_price("DDL", "1100", "1136")
89
+
90
+ # Average last traded price over the last N sessions (ending at latest session)
91
+ avg_price_latest = financegy.get_average_price("DDL", 30)
92
+
93
+ # Volatility over the last N sessions (weekly log-return volatility + annualized)
94
+ volatility = financegy.get_sessions_volatility("DDL", 30)
95
+
96
+ # Year-to-date high and low traded prices
97
+ ytd_high_low = financegy.get_ytd_high_low("DDL")
98
+
99
+ # --------------------------
100
+ # Utilities
101
+ # --------------------------
102
+
103
+ # Convert results to a DataFrame
104
+ df = financegy.to_dataframe(securities)
105
+
106
+ # Export to CSV / Excel
107
+ financegy.save_to_csv(securities, filename="securities.csv", silent=True)
108
+ financegy.save_to_excel(securities, filename="securities.xlsx", silent=True)
109
+
110
+ # Clear FinanceGY cache directory
111
+ financegy.clear_cache(silent=True)
112
+ ```
113
+
114
+ ---
115
+
116
+ ## API Reference
117
+
118
+ ### Core Data Retrieval
119
+
120
+ | Function | Description |
121
+ | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
122
+ | `get_securities()` | Returns all currently traded securities on the GSE. |
123
+ | `get_security_by_symbol(symbol)` | Returns the full security name for a ticker symbol (e.g., `"DDL"` → `"Demerara Distillers Limited"`). |
124
+ | `get_recent_trade(symbol)` | Returns the most recent trade information for the given security. |
125
+ | `get_security_recent_year(symbol)` | Returns all trade data for the most recent year available for the selected security. |
126
+ | `get_session_trades(session)` | Returns trade data for **all** securities during a specific trading session. |
127
+ | `get_security_session_trade(symbol, session)` | Returns trade data for a **specific** security during a specific session. |
128
+ | `search_securities(query)` | Searches securities whose names or ticker symbols match the given query (partial match). |
129
+ | `get_trades_for_year(symbol, year)` | Returns all trade records for a specific security during a given year. |
130
+ | `get_historical_trades(symbol, start_date, end_date)` | Returns historical trades within the specified date range (`dd/mm/yyyy`, `mm/yyyy`, or `yyyy`). |
131
+
132
+ ### Analytics / Calculation Functions
133
+
134
+ | Function | Description |
135
+ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
136
+ | `get_previous_close(symbol)` | Returns the most recent closing/last trade price for the security. |
137
+ | `get_price_change(symbol)` | Returns absolute price difference between the most recent trade and the previous session close. |
138
+ | `get_price_change_percent(symbol)` | Returns percent price change between the most recent trade and the previous session close. |
139
+ | `get_latest_session_for_symbol(symbol)` | Returns the latest trade dict for the symbol (includes the latest `session`). |
140
+ | `get_sessions_average_price(symbol, session_start, session_end)` | Returns the average last traded price over a session range (inclusive). |
141
+ | `get_average_price(symbol, session_number)` | Returns the average last traded price over the last **N** sessions ending at the latest session. |
142
+ | `get_sessions_volatility(symbol, session_number)` | Returns volatility over the last **N** sessions using log returns (weekly + annualized). |
143
+ | `get_ytd_high_low(symbol)` | Returns year-to-date highest and lowest traded prices for the security. |
144
+
145
+ ### Utilities
146
+
147
+ | Function | Description |
148
+ | ---------------------------------------------------------------------- | --------------------------------------------------------------- |
149
+ | `to_dataframe(data)` | Converts FinanceGY list/dict results into a `pandas.DataFrame`. |
150
+ | `save_to_csv(data, filename="output.csv", path=None, silent=False)` | Saves data to a CSV file. |
151
+ | `save_to_excel(data, filename="output.xlsx", path=None, silent=False)` | Saves data to an Excel file. |
152
+ | `clear_cache(silent=False)` | Completely clears the FinanceGY cache directory. |
153
+
154
+ ---
155
+
156
+ ## Caching System
157
+
158
+ FinanceGY includes a lightweight local caching system designed to speed up repeated requests and reduce unnecessary calls.
159
+
160
+ Whenever you call a data retrieval function (such as `get_securities()` or `get_recent_trade()`), FinanceGY automatically checks whether a cached response already exists for that specific query:
161
+
162
+ - If a valid cache file (less than 7 days old since sessions are held once per week) is found, the result is returned instantly from the cache.
163
+ - If the cache is missing, disabled, or older than one week, FinanceGY fetches fresh data from the GSE and updates the cache automatically.
164
+
165
+ All cache files are stored in a local `cache/` directory as small JSON files containing the retrieved data and a timestamp.
166
+
167
+ You can manually clear all cached data at any time:
168
+
169
+ ```python
170
+ import financegy
171
+
172
+ financegy.clear_cache()
173
+ ```
174
+
175
+ This will delete all cached files and force the next data request to fetch fresh data directly from the source.
176
+
177
+ If you prefer to bypass the cache for a specific call, simply pass `use_cache=False` to any function. For example:
178
+
179
+ ```python
180
+ # Force a fresh fetch from the GSE, ignoring cached data
181
+ recent_trade = financegy.get_recent_trade("DDL", use_cache=False)
182
+ ```
183
+
184
+ By default, caching is enabled for all supported functions unless explicitly turned off.
185
+
186
+ ---
187
+
188
+ ## License
189
+
190
+ This project is licensed under the **MIT License**
191
+
192
+ ---
193
+
194
+ ## Example Use Case
195
+
196
+ ```python
197
+ import financegy
198
+
199
+ ddl_recent = financegy.get_security_recent("DDL")
200
+ print(ddl_recent)
201
+ ```
@@ -0,0 +1,15 @@
1
+ financegy/__init__.py,sha256=SY0WDJGydD-9fU9i3Yff2WI8mrreGfFy22XSlSEPlJI,1664
2
+ financegy/config.py,sha256=lAuUzlFaa7qQ4CN2LVHRQ93LQ7jbhaC95Voz6PpGh_k,193
3
+ financegy/cache/cache_manager.py,sha256=c-VW3tk2A-Z-hMrTN4d_OOB6Zse9r-hrAcNhpBY6Sjo,1840
4
+ financegy/core/parser.py,sha256=tU6bFDVTW6ztKeDWQBL7RuxJGTIjeGuMk3SUF_lTWKY,18181
5
+ financegy/core/request_handler.py,sha256=g0C0R-nvIvicAhxnCEAtTU8buVtzUn8725EERvBA6ZU,276
6
+ financegy/helpers/safe_text.py,sha256=pskFh-ejjVAR8f_NBL5x3EwuBtd9OocAKN6ozqNDPhs,141
7
+ financegy/helpers/to_float.py,sha256=VVE3fkHzIE2un6zD50au_U2b_Luh13p3-T84fxEE6Xo,191
8
+ financegy/modules/portfolio.py,sha256=HFWw1FenJ_pABQhF7OlpP6OXuLCiyQBmwyXLrj-g6WQ,5483
9
+ financegy/modules/securities.py,sha256=_1f0-aZI7xWH5ndk5KSRVkqage3OpMbxaIod4W1xBy8,14687
10
+ financegy/utils/utils.py,sha256=mqbjZ4em_a7rZyDgCjFswspEIL_WUPOXa8siAuxZuoY,1434
11
+ financegy-3.0.dist-info/licenses/LICENSE,sha256=HGLhx0fI215whUzIvTFdFivB447d_IdIIIRncUCQaEs,1088
12
+ financegy-3.0.dist-info/METADATA,sha256=XwV5KpXYnrTusYQKWzHnFwgD4KFNWWggmFwBD1kaKzM,9674
13
+ financegy-3.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
14
+ financegy-3.0.dist-info/top_level.txt,sha256=TpdYDxtK61m5xnvvzbqnDVJ82gphEqxnXN_Ur8rjvxQ,10
15
+ financegy-3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,141 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: financegy
3
- Version: 1.5
4
- Summary: Unofficial Python library for accessing GSE (Guyana Stock Exchange) financial data
5
- Author-email: Ezra Minty <ezranminty@gmail.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/xbze3/financegy
8
- Project-URL: Issues, https://github.com/xbze3/financegy/issues
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
- Requires-Dist: requests
12
- Requires-Dist: beautifulsoup4
13
- Requires-Dist: pandas
14
- Requires-Dist: openpyxl
15
- Dynamic: license-file
16
-
17
- # 🏦 FinanceGY
18
-
19
- **FinanceGY** is an unofficial Python library for accessing financial data from the **Guyana Stock Exchange (GSE)**. It provides a simple and consistent interface for retrieving information on traded securities, recent trade data, and session details, all programmatically.
20
-
21
- ---
22
-
23
- ## Installation
24
-
25
- ```bash
26
- pip install financegy
27
- ```
28
-
29
- ---
30
-
31
- ## Quick Start
32
-
33
- ```python
34
- import financegy
35
-
36
- # Get a list of all traded securities
37
- securities = financegy.get_securities()
38
-
39
- # Get the name of a security by its ticker symbol
40
- security_name = financegy.get_security_by_symbol("DDL")
41
-
42
- # Get the most recent trade data for a security
43
- recent_trade = financegy.get_recent_trade("DDL")
44
-
45
- # Get all trade data for the most recent year
46
- recent_year = financegy.get_security_recent_year("DDL")
47
-
48
- # Get trade data for a specific trading session
49
- session_trades = financegy.get_session_trades("1136")
50
-
51
- # Get session trade data for a specific security
52
- security_session_trade = financegy.get_security_session_trade("DDL", "1136")
53
-
54
- # Search for securities by name or symbol
55
- search_results = financegy.search_securities("DDL")
56
-
57
- # Get all trades for a given year
58
- year_trades = financegy.get_trades_for_year("DDL", "2019")
59
-
60
- # Get historical trades within a date range - (yyyy) / (mm/yyyy) / (dd/mm/yyyy)
61
- historical_trades = financegy.get_historical_trades(
62
- symbol="DDL",
63
- start_date="01/06/2020",
64
- end_date="01/2022"
65
- )
66
- ```
67
-
68
- ---
69
-
70
- ## Data Retrieval
71
-
72
- | Function | Description |
73
- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
74
- | `get_securities()` | Returns a list of all currently traded securities on the GSE. |
75
- | `get_security_by_symbol(symbol: str)` | Retrieves the full name of a security using its ticker symbol (e.g., `"DDL"` → `"Demerara Distillers Limited"`). |
76
- | `get_recent_trade(symbol: str)` | Returns the most recent trade information for the given security. |
77
- | `get_security_recent_year(symbol: str)` | Fetches all trade data for the most recent year of the selected security. |
78
- | `get_session_trades(session: str)` | Retrieves trade data for all securities during a specific trading session. |
79
- | `get_security_session_trade(symbol: str, session: str)` | Retrieves trade data for a specific security in a given trading session. |
80
- | `search_securities(query: str)` | Searches for securities whose names or ticker symbols match the given query. |
81
- | `get_trades_for_year(symbol: str, year: str)` | Returns all trade records for a specific security during a given year. |
82
- | `get_historical_trades(symbol: str, start_date: str, end_date: str)` | Fetches historical trade data for a security within the specified date range (`dd/mm/yyyy`, `mm/yyyy`, `yyyy` format). |
83
-
84
- ---
85
-
86
- ### Data Utilities
87
-
88
- | Function | Description |
89
- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
90
- | `to_dataframe(data)` | Converts a list (or dictionary) of trade data into a Pandas DataFrame for easy analysis. Raises `TypeError` if the data is not properly formatted. |
91
- | `save_to_csv(data, filename: str = "output.csv", path: str = None)` | Saves the given data to a CSV file. By default, the file is saved to the current working directory. Returns `True` after saving successfully. |
92
- | `save_to_excel(data, filename: str = "output.xlsx", path: str = None)` | Saves the given data to an Excel `.xlsx` file. By default, the file is saved to the current working directory. Returns `True` after saving successfully. |
93
-
94
- ---
95
-
96
- ## Caching System
97
-
98
- FinanceGY includes a lightweight local caching system designed to speed up repeated requests and reduce unnecessary calls.
99
-
100
- Whenever you call a data retrieval function (such as `get_securities()` or `get_recent_trade()`), FinanceGY automatically checks whether a cached response already exists for that specific query:
101
-
102
- - If a valid cache file (less than 7 days old since sessions are held once per week) is found, the result is returned instantly from the cache.
103
- - If the cache is missing, disabled, or older than one week, FinanceGY fetches fresh data from the GSE and updates the cache automatically.
104
-
105
- All cache files are stored in a local `cache/` directory as small JSON files containing the retrieved data and a timestamp.
106
-
107
- You can manually clear all cached data at any time:
108
-
109
- ```python
110
- import financegy
111
-
112
- financegy.clear_cache()
113
- ```
114
-
115
- This will delete all cached files and force the next data request to fetch fresh data directly from the source.
116
-
117
- If you prefer to bypass the cache for a specific call, simply pass `use_cache=False` to any function. For example:
118
-
119
- ```python
120
- # Force a fresh fetch from the GSE, ignoring cached data
121
- recent_trade = financegy.get_recent_trade("DDL", use_cache=False)
122
- ```
123
-
124
- By default, caching is enabled for all supported functions unless explicitly turned off.
125
-
126
- ---
127
-
128
- ## License
129
-
130
- This project is licensed under the **MIT License**
131
-
132
- ---
133
-
134
- ## Example Use Case
135
-
136
- ```python
137
- import financegy
138
-
139
- ddl_recent = financegy.get_security_recent("DDL")
140
- print(ddl_recent)
141
- ```
@@ -1,12 +0,0 @@
1
- financegy/__init__.py,sha256=j938wP-4t3qnjgUOgLzr4lL9CevuNMGH10DWgDd-4Ew,929
2
- financegy/config.py,sha256=SD5LpUVZvthUJEN2KxInRzoOLZCgSMXHV-tc1kKSPt8,193
3
- financegy/cache/cache_manager.py,sha256=l2J7Fj3g0EnkJLGeIMuaslwFI9-6Ipmf4PHJLUMphAU,1859
4
- financegy/core/parser.py,sha256=Cuej95KUp_FJL58cskzdeaA2DNBDPR2v6JCo5jCZlKk,11071
5
- financegy/core/request_handler.py,sha256=g0C0R-nvIvicAhxnCEAtTU8buVtzUn8725EERvBA6ZU,276
6
- financegy/modules/securities.py,sha256=PNEqfot_cqneO0j4muRfYC5sbCUaZaJoKiq1exBXSz4,5233
7
- financegy/utils/utils.py,sha256=l0oOE36Br8A9uZp_1Cq82LZCKnZLEvLGCbExJzCkhA0,1328
8
- financegy-1.5.dist-info/licenses/LICENSE,sha256=HGLhx0fI215whUzIvTFdFivB447d_IdIIIRncUCQaEs,1088
9
- financegy-1.5.dist-info/METADATA,sha256=8XkenLyrcfzT04WHrM5YHudRRuFcdOGcPmR4eyMqtEw,6923
10
- financegy-1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- financegy-1.5.dist-info/top_level.txt,sha256=TpdYDxtK61m5xnvvzbqnDVJ82gphEqxnXN_Ur8rjvxQ,10
12
- financegy-1.5.dist-info/RECORD,,