Pyratings

Latest version: v0.6.1

Safety actively analyzes 638466 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.5.0

Added
- ``pyratings.get_scores_from_ratings``
- ``pyratings.get_scores_from_warf``
- ``pyratings.get_ratings_from_scores``
- ``pyratings.get_ratings_from_warf``
- ``pyratings.get_warf_from_scores``
- ``pyratings.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.Series``
- ``pyratings.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.Series``
- ``pyratings.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()`` -> Use ``pyratings.get_ratings_from_scores`` or
``pyratings.get_ratings_from_warf`` instead.
- ``to_ratings_from_scores()`` -> Use ``pyratings.get_ratings_from_scores`` instead.
- ``to_scores_from_ratings()`` -> Use ``pyratings.get_scores_from_ratings`` instead.
- ``to_score_from_warf()`` -> Use ``pyratings.get_scores_from_warf`` instead.
- ``to_warf_from_ratings()`` -> Use ``pyratings.get_warf_from_ratings`` instead.

0.4.2

Refactored
- Added unit tests in order to arrive at 100% code coverage

0.4.1

Changed
- Function signature of ``pyratings.get_pure_ratings``.

0.4.0

Added
- Computation of `best`, `worst`, and `second_best` ratings on a security basis.
- ``pyratings.get_best_ratings``
- ``pyratings.get_second_best_ratings``
- ``pyratings.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.
- ``doctest`` integration into ``pytest``.

Changed
- Some functions such as ``to_scores_from_ratings`` and ``get_pure_ratings`` got
their signatures changed.<br>
They now accept a ``Dict[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 a ``pd.DataFrame`` in one step.
- "S&P" and "Moody's" are not no valid rating provider anymore. The new acronyms are
"SP" and "Moody".
- ``pyratings.get_pure_ratings`` output column names now have the suffix "_clean".
- ``to_ratings_from_scores`` became an internal function.
- ``get_rating`` is now the go-to function when it comes to translate a single
rating score or numerical WARF into a rating. It replaces
``to_ratings_from_avg_warf`` and ``get_avg_rating``.
- ``get_avg_rating_score`` and ``get_avg_warf`` shared the exact same code. These
functions have been merged into ``get_weighted_average``.
- Internal code optimizations.

Removed
- ``get_avg_rating``
- ``get_avg_rating_score``
- ``get_avg_warf``
- ``to_ratings_from_avg_warf``
- ``to_ratings_from_warf``

Fixed
- ``get_weighted_average`` (previously ``get_avg_rating_score`` and ``get_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

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 ``src`` layout.
- Package resource management now using ``pkg_resources`` from Python's standard
library.

Improved
- Use ``tox`` for unit tests.

0.2.0

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.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.