# Changelog

All notable changes to this project will be documented in this file.

## [1.4.0] - 2026-09-27

### Added

* Added a Textual TUI example demonstrating live exchange rate conversion.
* Added a Textual application that provides an interactive
  playground for the money format specification.
* Added `DefaultProvider.prefetch_rates` method to fetch all available rates
  in a single request.

## [1.3.3] - 2026-09-24

### Fixed

* Further fix default locale detection on Windows, ensuring that
  `en_US` is used as a fallback when locale detection fails.

## [1.3.2] - 2026-09-23

### Fixed

* Fix default locale detection on Windows, with an
  `en_US` fallback when detection fails.

## [1.3.1] - 2026-09-21

### Fixed

* Fix a bug where the Babel formatting backend did not account for
  currency minor units.
* Fix the return type of `Money.sum` and improve its bulk addition logic.

## [1.3.0] - 2026-09-20

### Added

#### Currency

* Added `Currency.from_country(country_code)` classmethod to map ISO 3166-1
  country codes to their primary ISO 4217 currencies.

#### Currency Conversion

* Added exchange-rate based currency conversion through `Money.exchange_to()`.
* Added the `ExchangeRate` type for representing exchange rates between currencies.
* Added `ExchangeRateInfo` for associating provider, rate type, timestamp, and
  additional information with an exchange rate.
* Added the `ExchangeRateProvider` protocol for defining exchange-rate providers.
* Added `DefaultProvider` for obtaining exchange rates from external providers.
* Added `FixedRateProvider` for supplying and managing fixed exchange rates.
* Added support for exchange-rate inversion and cross-rate derivation.
* Added serialization and deserialization of exchange rates, including the
  source lineage of derived rates.
* Added support for selecting the upstream provider used by DefaultProvider.

#### Documentation

* Added a comprehensive guide for currency conversion and exchange-rate providers.
* Documented exchange-rate construction, inversion, cross-rates, serialization,
  and custom providers.
* Expanded the API documentation for the conversion functionality.
* Documented the project's design philosophy and implementation principles.

#### Testing

* Added extensive tests for currency conversion and exchange-rate providers.
* Expanded test coverage for exchange-rate construction, derivation,
  serialization, and provider behavior.

## [1.2.0] - 2026-09-03

I am happy to announce that **PyCents** added support for crypto
and custom currencies.

### Added

#### Custom Currencies

* Added the `Xcy` enum-like class for cryptocurrencies and custom currencies.
* Added pre-registered definitions for popular cryptocurrencies.
* Added custom currency registration through `Xcy.register`.
* Integrated custom currencies seamlessly with the locale-aware formatting engine.

#### Money API

* Added `as_majors` and `as_minors` properties as the preferred API for accessing
  major and minor unit amounts. The existing `to_decimal()` and `minor_units`
  APIs are deprecated.

* Updated `Money.from_major` to require an explicit rounding mode when rounding
  is necessary.
* Added factory method `from_minor` to construct `Money` instance from minor units.
* Promoted `UnroundedMoney` to a public API type for representing intermediate,
  high-precision monetary calculations.
* Added `UnroundedMoney.from_major()` for constructing unrounded amounts from
  major currency units. The existing `UnroundedMoney.from_decimal()` API is deprecated.
* Added `as_majors()` property to `UnroundedMoney` to access the stored
  monetary amount in major units.

#### Documentation

* Improved the documentation and added a guide for using custom currencies.

## [1.1.0] - 2026-08-21

### Added

* Added cash method to the Money class to support physical cash transactions.

## [1.0.0] - 2026-08-20

### Added

* Initial stable production release. PyCents public API is frozen and fully
  covered by tests.
