sgfixedincome_pkg
A python package to aggregate and analyse data on SGD-denominated retail fixed income products in Singapore.
Are you a non-technical user? Use the app here.
Introduction
This python package contains:
scraper.py: A generalized web scraper to extract fixed deposit rates data from bank websites that display this data in a suitable table format.mas_api_client.py: An API client that interacts with several Monetary Authority of Singapore (MAS) bonds and bills API endpoints. In particular, we provide functions to extract data on Singapore Savings Bonds (SSB) and Treasury bills (T-bills).consolidate.py: Functions to format, merge, and consolidate data obtained from scraping bank websites and from the MAS API.analysis.py: Functions to analyse and visualise extracted fixed income product data.streamlit_app/app.py: code for streamlit web interface
Installation
The package can be installed using:
$ pip install sgfixedincome_pkg
Documentation and Usage
Detailed documentation can be found on Read the Docs.
You can also explore detailed vignettes demonstrating the package's functionality:
- Main vignette: fetch, analyze, and visualize retail fixed income product data.
- MAS vignette: how to use the MAS bonds and bills API client and related functions
- Scraper vignette: how to use functions that scrape bank fixed deposit websites
Or simply explore the streamlit app.
Running the Streamlit App
After installation, find the installation location with:
$ pip show sgfixedincome_pkg
Then run:
$ streamlit run "C:\Path\To\site-packages\sgfixedincome_pkg\streamlit_app\app.py"
For example:
$ streamlit run "C:\Users\John\Desktop\Folder\test_env\Lib\site-packages\sgfixedincome_pkg\streamlit_app\app.py"
This will open a browser window with an interactive dashboard.
Note: The web interface requires an active internet connection to fetch current rates and product information.
The App's Data Fetching & Caching Logic
To optimize performance and reliability:
- Data is scraped and stored in a central cache once every 24 hours, using this Github repository.
- If the cached data has any fetch failures but a previous successful version exists (no failures), you'll see an option to use that version instead.
- If the cached data is more than 2 days old, the tool will fetch fresh data directly.
When running the tool:
- If you're using the hosted web app, you'll see whether the data is from the cache or freshly fetched
- If you're running locally (streamlit run after pip install), the tool will always fetch fresh data
- The data timestamp (in Singapore time) is always displayed in the sidebar
If present, warnings and failures will be shown in the sidebar to highlight any data fetching issues.
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
sgfixedincome_pkg was created by Gideon Tay. It is licensed under the terms of the MIT license.
Contact
Reach out to me on LinkedIn if you have any questions or suggestions.
Credits
sgfixedincome_pkg was created with cookiecutter and the py-pkgs-cookiecutter template.
Metadata
Release files for sgfixedincome_pkg 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sgfixedincome_pkg-0.2.0.tar.gz | 27.8 kB | Without provenance | Details for sgfixedincome_pkg-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sgfixedincome_pkg-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for sgfixedincome_pkg-0.2.0-py3-none-any.whl |
Total release size: 58.2 kB
Release files / sgfixedincome_pkg-0.2.0.tar.gz
| Download URL | sgfixedincome_pkg-0.2.0.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22127978e19362d5c11d7841f91ceed94952be1c39ba51dbeee3825a99719b4e
|
|
BLAKE2b-256 checksum How to use checksums |
3d1f12feef2020eb727bb53a45254c77671a64ad36f83dc924f82cdbdb3f6481
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.5 Windows/11
|
Release files / sgfixedincome_pkg-0.2.0-py3-none-any.whl
| Download URL | sgfixedincome_pkg-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0eb4f11039549b97f9ea74e9769846dfae8fb55d926e9185b40ab959403dd8c4
|
|
BLAKE2b-256 checksum How to use checksums |
00ec0e0db92b13fd2b393e3c293edddde08cebae97326c3489431f9d18fc45e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.5 Windows/11
|
Security for sgfixedincome_pkg 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.