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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file reformat-money-0.0.2.tar.gz
.
File metadata
- Download URL: reformat-money-0.0.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 238e56e996e634da06cf890d0b98cc90cf35f13301a8d0a4aca1854b9bb675a0 |
|
MD5 | 9a8c5e48cdd6bda3f069193b07d94b47 |
|
BLAKE2b-256 | f5ee1f741314a94819c663b1cc14c3fd060d0b41761ef42de8894ca40c4a88c8 |
File details
Details for the file reformat_money-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: reformat_money-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e5c741634d934a7dae39dbbbea22aec3dc71e6fcc581461d4dbf4995b248e5d |
|
MD5 | 075f606766a0a50a108fcebc93f66be9 |
|
BLAKE2b-256 | f6389f3cc888fdbb696e5aff8fabe7a9e823ab63462f01a7f993c4b17f63a8b1 |