Skip to main content

A script to fix money references within a codebase.

Project description

Reformat Money

reformat-money is a simple command line utility that will attempt to reformat the usage of py-moneyed Money within the application into a standard string format.

The driver behind this is that usage of money within an application needs to be consistent and precise. The main aim of this utility is to stop an application defining money as float, which can lead to unpredictable errors. In order to keep consistency, where possible all instances of money will have the amount reformatted to a string.

The following will be reformatted.

Money(100.20, "USD") --> Money("100.20", "USD")
Money(200, "USD") --> Money("200.00", "USD")

If it is not possible to reformat, the filename will be logged for the user to inspect manually.

It is advised that you have your code committed to version control before running reformat-money to allow you to roll back changes that you are not happy with.

Installation

Installation is simple:

pip install reformat-money

Usage

This utility can be used by specifying either a single file or directory, for example

reformat-money package_name

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reformat-money-0.0.2.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

reformat_money-0.0.2-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page