Changelog
All notable changes to this project will be documented in this file.
The format is loosely based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.6.2 - 2025-06-16
Improved
Security
- Updated third-party dependencies.
0.6.1 - 2023-02-24
Security
Improved
0.6.0 - 2023-01-18
Added
- Option to choose between three different strategies to translate scores into short-term ratings (#24).
- Functionality to remove prefix '(P)' when cleaning ratings (#27).
- Functions to consolidate ratings and return numerical rating scores
(#37):
get_best_scoresget_second_best_scoresget_worst_scores
- Function
consolidate_ratings: Wrapper function forget_best_ratings,get_second_best_ratings, andget_worst_ratings(#37).
Changed
- BREAKING CHANGE: Automatic column naming
(#9).
get_scores_from_ratings()
When input apd.Series, the name of the output series will now becomeratings.nameprefixed with "rtg_score_".
When input apd.DataFrame, the column names of the output frame will now becomeratings.columnsprefixed with "rtg_score_".get_warf_from_ratings()
When input a pd.Series, the name of the output series will now becomeratings.nameprefixed with "warf_".
When input a pd.DataFrame, the column names of the output frame will now becomeratings.columnsprefixed with "warf_".
- BREAKING CHANGE: Translations of short-term ratings are now different (#16).
Fixed
- Short-term DBRS rating entries in Ratings.db (#29).
Improved
- Splitting the code base into multiple files in order to increase maintainability (#8).
- Internal checks have been improved (#20).
- Documentation has been updated and will now be created via mkdocs and mkdocstrings.
- Using nox to test the code base against multiple Python versions.
- Make code base flake8 compliant.
- Use pre-commit to ensure good quality before commiting/sending PRs.
- Use python-kacl in order to maintain CHAGELOG.
0.5.4 - 2022-07-07
Refactored
- Moved from
setup.pytopyproject.tomlconfiguration file.
0.5.3 - 2022-04-05
Added
- Complete documentation now available on public GitHub Pages at https://hsbc.github.io/pyratings/.
0.5.2 - 2022-01-24
Refactored
- Moved sphinx configuration to
docsrcfolder. - Documentation data for GitHub pages can be found under
docs.
0.5.1 - 2022-01-06
Security
- Removed links to internal network drives in
tox.ini. - Removed links to GitHub issues in this
CHANGELOG.mdas they link to internal GitHub repo.
0.5.0 - 2022-01-03
Added
pyratings.get_scores_from_ratingspyratings.get_scores_from_warfpyratings.get_ratings_from_scorespyratings.get_ratings_from_warfpyratings.get_warf_from_scorespyratings.get_warf_from_ratings
Changed
- BREAKING CHANGE: Internal resource handling now utilizes
importlib.resources, which makes Python >=3.9 mandatory. - BREAKING CHANGE: Some function signatures have been changed:
pyratings.get_pure_ratings
--Old--:get_pure_ratings(ratings: Union[pd.Series, List[pd.Series], pd.DataFrame]) -> Union[pd.Series, List[pd.Series], pd.DataFrame]
--New--:get_pure_ratings(ratings: Union[str, pd.Series, pd.DataFrame]) -> Union[str, pd.Series, pd.DataFrame]pyratings.get_best_ratings
--Old--:get_best_ratings(ratings: Dict[str, pd.Series], tenor: Optional[str] = "long-term") -> pd.Series
--New--:get_best_ratings(ratings: pd.DataFrame, rating_provider_input: List[str] = None, rating_provider_output: str = "S&P", tenor: str = "long-term") -> pd.Seriespyratings.get_second_best_ratings
--Old--:get_second_best_ratings(ratings: Dict[str, pd.Series], tenor: Optional[str] = "long-term") -> pd.Series
--New--:get_second_best_ratings(ratings: pd.DataFrame, rating_provider_input: List[str] = None, rating_provider_output: str = "S&P", tenor: str = "long-term") -> pd.Seriespyratings.get_worst_ratings
--Old--:get_worst_ratings(ratings: Dict[str, pd.Series], tenor: Optional[str] = "long-term") -> pd.Series
--New--:get_worst_ratings(ratings: pd.DataFrame, rating_provider_input: List[str] = None, rating_provider_output: str = "S&P", tenor: str = "long-term") -> pd.Series
Removed
get_rating()-> Usepyratings.get_ratings_from_scoresorpyratings.get_ratings_from_warfinstead.to_ratings_from_scores()-> Usepyratings.get_ratings_from_scoresinstead.to_scores_from_ratings()-> Usepyratings.get_scores_from_ratingsinstead.to_score_from_warf()-> Usepyratings.get_scores_from_warfinstead.to_warf_from_ratings()-> Usepyratings.get_warf_from_ratingsinstead.
0.4.2 - 2021-11-19
Refactored
- Added unit tests in order to arrive at 100% code coverage
0.4.1 - 2021-11-16
Changed
- Function signature of
pyratings.get_pure_ratings.
0.4.0 - 2021-03-26
Added
- Computation of
best,worst, andsecond_bestratings on a security basis.pyratings.get_best_ratingspyratings.get_second_best_ratingspyratings.get_worst_ratings
- Computation of WARF buffer, i.e. distance from current WARF to the next maxWARF.
pyratings.get_warf_buffer
- Documentation
- Overview
- Getting started
- API Reference
Improved
- Updated docstrings.
doctestintegration intopytest.
Changed
- Some functions such as
to_scores_from_ratingsandget_pure_ratingsgot their signatures changed.
They now accept aDict[str, pd.Series], where the dictionary keys represent the rating provider and the dictionary values represent the respective ratings. This will allow transforming multiple columns of apd.DataFramein one step. - "S&P" and "Moody's" are not no valid rating provider anymore. The new acronyms are "SP" and "Moody".
pyratings.get_pure_ratingsoutput column names now have the suffix "_clean".to_ratings_from_scoresbecame an internal function.get_ratingis now the go-to function when it comes to translate a single rating score or numerical WARF into a rating. It replacesto_ratings_from_avg_warfandget_avg_rating.get_avg_rating_scoreandget_avg_warfshared the exact same code. These functions have been merged intoget_weighted_average.- Internal code optimizations.
Removed
get_avg_ratingget_avg_rating_scoreget_avg_warfto_ratings_from_avg_warfto_ratings_from_warf
Fixed
get_weighted_average(previouslyget_avg_rating_scoreandget_avg_warf) now handle missing rating scores/WARF differently. Previously, they have been ignored. However, this led to a too positive average rating/WARF. Now, only securities with a rating score/WARF available will contribute to the average computation. To put it differently, the average score/WARF is solely based on rated securities.
0.3.0 - 2021-02-22
Added
- Computation of average rating.
- Computation of average WARF.
- Translation from traditional ratings to WARF and vice versa.
Changed
- Adjusted WARF and MaxWARF values for ratings Ca and C to allow for differentiation of translated values between ratings Ca/C/D.
- Folder layout now adheres to
srclayout. - Package resource management now using
pkg_resourcesfrom Python's standard library.
Improved
- Use
toxfor unit tests.
0.2.0 - 2020-12-18
Added
- More rating agencies: DBRS, Bloomberg composite, ICE.
- Short-term ratings.
Improved
- Rating scales are now maintained within an SQLite database. Previously, rating
scales had been hard coded in a traditional Python
dict.
Fixed
- Cleansing of unsolicited ratings.
0.1.0 - 2020-12-09
Added
- Function to clean ratings (delete watches).
- Function to translate S&P/Fitch/Moody's credit ratings into rating scores.
- Function to translate rating scores into S&P/Fitch/Moody's credit ratings.