financegy 1.3__py3-none-any.whl → 2.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.
- financegy/__init__.py +24 -6
- financegy/cache/cache_manager.py +11 -13
- financegy/config.py +2 -2
- financegy/core/parser.py +346 -106
- financegy/helpers/safe_text.py +3 -0
- financegy/helpers/to_float.py +10 -0
- financegy/modules/securities.py +318 -6
- financegy/utils/utils.py +61 -0
- financegy-2.0.dist-info/METADATA +201 -0
- financegy-2.0.dist-info/RECORD +14 -0
- {financegy-1.3.dist-info → financegy-2.0.dist-info}/WHEEL +1 -1
- financegy-1.3.dist-info/METADATA +0 -153
- financegy-1.3.dist-info/RECORD +0 -11
- {financegy-1.3.dist-info → financegy-2.0.dist-info}/licenses/LICENSE +0 -0
- {financegy-1.3.dist-info → financegy-2.0.dist-info}/top_level.txt +0 -0
financegy-1.3.dist-info/METADATA
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: financegy
|
|
3
|
-
Version: 1.3
|
|
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
|
-
Dynamic: license-file
|
|
14
|
-
|
|
15
|
-
# 🏦 FinanceGY
|
|
16
|
-
|
|
17
|
-
**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.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Installation
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
pip install financegy
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Quick Start
|
|
30
|
-
|
|
31
|
-
```python
|
|
32
|
-
import financegy
|
|
33
|
-
|
|
34
|
-
# Get a list of all traded securities
|
|
35
|
-
securities = financegy.get_securities()
|
|
36
|
-
|
|
37
|
-
# Get the name of a security by its ticker symbol
|
|
38
|
-
security_name = financegy.get_security_by_symbol("DDL")
|
|
39
|
-
|
|
40
|
-
# Get the most recent trade data for a security
|
|
41
|
-
recent_trade = financegy.get_recent_trade("DDL")
|
|
42
|
-
|
|
43
|
-
# Get all trade data for the most recent year
|
|
44
|
-
recent_year = financegy.get_security_recent_year("DDL")
|
|
45
|
-
|
|
46
|
-
# Get trade data for a specific trading session
|
|
47
|
-
session_trades = financegy.get_session_trades("1136")
|
|
48
|
-
|
|
49
|
-
# Get session trade data for a specific security
|
|
50
|
-
security_session_trade = financegy.get_security_session_trade("DDL", "1136")
|
|
51
|
-
|
|
52
|
-
# Search for securities by name or symbol
|
|
53
|
-
search_results = financegy.search_securities("DDL")
|
|
54
|
-
|
|
55
|
-
# Get all trades for a given year
|
|
56
|
-
year_trades = financegy.get_trades_for_year("DDL", "2019")
|
|
57
|
-
|
|
58
|
-
# Get historical trades within a date range (dd/mm/yyyy)
|
|
59
|
-
historical_trades = financegy.get_historical_trades(
|
|
60
|
-
symbol="DDL",
|
|
61
|
-
start_date="01/06/2020",
|
|
62
|
-
end_date="01/01/2022"
|
|
63
|
-
)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Function Overview
|
|
69
|
-
|
|
70
|
-
#### `get_securities()`
|
|
71
|
-
|
|
72
|
-
Returns a list of all currently traded securities on the Guyana Stock Exchange.
|
|
73
|
-
|
|
74
|
-
#### `get_security_by_symbol(symbol: str)`
|
|
75
|
-
|
|
76
|
-
Retrieves the full name of a security using its ticker symbol (e.g., `"DDL"` → `"Demerara Distillers Limited"`).
|
|
77
|
-
|
|
78
|
-
#### `get_recent_trade(symbol: str)`
|
|
79
|
-
|
|
80
|
-
Returns the most recent trade information for the given security.
|
|
81
|
-
|
|
82
|
-
#### `get_security_recent_year(symbol: str)`
|
|
83
|
-
|
|
84
|
-
Fetches all trade data for the most recent year of the selected security.
|
|
85
|
-
|
|
86
|
-
#### `get_session_trades(session: str)`
|
|
87
|
-
|
|
88
|
-
Retrieves trade data for _all_ securities during a specific trading session.
|
|
89
|
-
|
|
90
|
-
#### `get_security_session_trade(symbol: str, session: str)`
|
|
91
|
-
|
|
92
|
-
Retrieves trade data for a specific security in a given trading session.
|
|
93
|
-
|
|
94
|
-
#### `search_securities(query: str)`
|
|
95
|
-
|
|
96
|
-
Searches for securities whose names or ticker symbols match the given query.
|
|
97
|
-
|
|
98
|
-
#### `get_trades_for_year(symbol: str, year: str)`
|
|
99
|
-
|
|
100
|
-
Returns all trade records for a specific security during a given year.
|
|
101
|
-
|
|
102
|
-
#### `get_historical_trades(symbol: str, start_date: str, end_date: str)`
|
|
103
|
-
|
|
104
|
-
Fetches historical trade data for a security within the specified date range (`dd/mm/yyyy` format).
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Caching System
|
|
109
|
-
|
|
110
|
-
FinanceGY includes a lightweight local caching system designed to speed up repeated requests and reduce unnecessary calls.
|
|
111
|
-
|
|
112
|
-
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:
|
|
113
|
-
|
|
114
|
-
- If a valid cache file (less than 7 days old since sessions are help once per week) is found, the result is returned instantly from the cache.
|
|
115
|
-
- If the cache is missing, disabled, or older than one week, FinanceGY fetches fresh data from the GSE and updates the cache automatically.
|
|
116
|
-
|
|
117
|
-
All cache files are stored in a local `cache/` directory as small JSON files containing the retrieved data and a timestamp.
|
|
118
|
-
|
|
119
|
-
You can manually clear all cached data at any time:
|
|
120
|
-
|
|
121
|
-
```python
|
|
122
|
-
import financegy
|
|
123
|
-
|
|
124
|
-
financegy.clear_cache()
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
This will delete all cached files and force the next data request to fetch fresh data directly from the source.
|
|
128
|
-
|
|
129
|
-
If you prefer to bypass the cache for a specific call, simply pass `use_cache=False` to any function. For example:
|
|
130
|
-
|
|
131
|
-
```python
|
|
132
|
-
# Force a fresh fetch from the GSE, ignoring cached data
|
|
133
|
-
recent_trade = financegy.get_recent_trade("DDL", use_cache=False)
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
By default, caching is enabled for all supported functions unless explicitly turned off.
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## License
|
|
141
|
-
|
|
142
|
-
This project is licensed under the **MIT License**
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Example Use Case
|
|
147
|
-
|
|
148
|
-
```python
|
|
149
|
-
import financegy
|
|
150
|
-
|
|
151
|
-
ddl_recent = financegy.get_security_recent("DDL")
|
|
152
|
-
print(ddl_recent)
|
|
153
|
-
```
|
financegy-1.3.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
financegy/__init__.py,sha256=c0b1JX1ZkQVxF984dIW-C6E24blvb1cSmmjY4Msh9kY,790
|
|
2
|
-
financegy/config.py,sha256=SD5LpUVZvthUJEN2KxInRzoOLZCgSMXHV-tc1kKSPt8,193
|
|
3
|
-
financegy/cache/cache_manager.py,sha256=l2J7Fj3g0EnkJLGeIMuaslwFI9-6Ipmf4PHJLUMphAU,1859
|
|
4
|
-
financegy/core/parser.py,sha256=w1JBLphaKSbKimQsGkfDMyj69zmIGtGClnqHxWHx-Lc,10259
|
|
5
|
-
financegy/core/request_handler.py,sha256=g0C0R-nvIvicAhxnCEAtTU8buVtzUn8725EERvBA6ZU,276
|
|
6
|
-
financegy/modules/securities.py,sha256=PNEqfot_cqneO0j4muRfYC5sbCUaZaJoKiq1exBXSz4,5233
|
|
7
|
-
financegy-1.3.dist-info/licenses/LICENSE,sha256=HGLhx0fI215whUzIvTFdFivB447d_IdIIIRncUCQaEs,1088
|
|
8
|
-
financegy-1.3.dist-info/METADATA,sha256=1wrYM-4anai8UX3HVbT5wXWb1gLlKvRQ9y2qUFZKYyE,4722
|
|
9
|
-
financegy-1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
financegy-1.3.dist-info/top_level.txt,sha256=TpdYDxtK61m5xnvvzbqnDVJ82gphEqxnXN_Ur8rjvxQ,10
|
|
11
|
-
financegy-1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|