Giter Club home page Giter Club logo

py-money's People

Contributors

jcmanzo avatar mohorev avatar nickyr avatar raymondjavaxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-money's Issues

Lib maintenance

Hi!
I see that this library is no longer maintained.
We "forked" it internally at Backmarket, for our needs (custom rounding, removal of float support), and we were wondering if we could publish our version as a replacement of yours.
We do have an open source strategy internally.
Is it something you'd like to discuss? With who I can get in touch about that?

Thanks!

uses babel 2.4.0

its forcing me to use babel 2.4.0 even if i already installed latest version of babel(2.6.0)

`__eq__` is too rigid

Hi!

The current implementation of __eq__ for Money is too rigid and cannot be used for inclusion tests:

>>> from money.currency import Currency
>>> from money.money import Money
>>> x = Money('10.00', Currency.USD)
>>> x in (None, Money('10.00', Currency.USD))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<...>/lib/python3.7/site-packages/money/money.py", line 80, in __eq__
    raise InvalidOperandError
money.exceptions.InvalidOperandError: Invalid operand types for operation
>>> x in (Money('10.00', Currency.USD), None)
True

Make Currency json serializable

Currency enum should be extending str as weel to make it serializable to json by default. Currently it results with the error:

TypeError: <Currency.USD: 'USD'> is not JSON serializable

Changing definition to this should solve the issue:

class Currency(str, Enum):
	...

And calling print(json.dumps(Currency.USD)) would correctly print: "USD".

money.exceptions.InvalidOperandError: Invalid operand types for operation

I have my spare code:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-

from money.money import Money
from money.currency import Currency							
x = Money('0.01', Currency.GBP)

words = 'alphabet'

for i in words:
	x += 0.01

print (x)

But when I run it it returns me:

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    x += 0.01
  File "C:\Program Files\Python36\lib\site-packages\money\money.py", line 81, in __add__
    raise InvalidOperandError
money.exceptions.InvalidOperandError: Invalid operand types for operation

I believe += is the problem

No PyPI distribution for OSX environment

$ pip install py-money
Collecting py-money
  Could not find a version that satisfies the requirement py-money (from versions: )
No matching distribution found for py-money

Please upload a sdist or a wheel for OSX environments.

Support No Currency Digits

Would love to contribute my part if possible

This is what I'm looking for:

>>> m = Money('3.24')
>>> m.format(currency_digits=False)
$324

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.