You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
Hi, I get the idea of this project, to have standardized methods and also standardized responses.
I also like the idea to standardize the pairs, as one exchange uses BTCUSD, another BTC/USD, another btcusd etc. which is quite a mess...
What is a bit strange to me, is to have classes for pairs. I don't understand why should I use a "strong type" for something that basically is a string. I also see that in some interfaces the formatting is a bit weird and doesn't really look useful, I mean e.g.
I saw his kind of try/catch in several interfaces and I was wondering why was it like that, then I tested and noticed, that if I pass a string for the pair, it raises an exception, which was not really expected...
Why not having an extension format_for method for string, instead?
This can be handy for exchanges with hundreds of pairs, like binance, bittrex. Creating all pairs as objects is not really necessary on my opinion, not even if you can automate this, as every day there are new pairs...
Ideally the formatter should convert a standard string in a string that the exchange wants.
I'd just have a formatting method expecting one of those standard way:
BASE-QUOTE, where "-" could be a different separator, like /, _ etc. like this it wouldn't be needed to create hundred of classes like this one:
class ETHBTCFormatter(PairFormatter):
"""ETH/BTC PairFormatter object."""
def __init__(self):
"""Initialize the Formatter instance."""
super(ETHBTCFormatter, self).__init__('ETH', 'BTC')
This looks hard to maintain, especially if you think that every week there are new pairs added to exchanges like binance, and sometimes some pairs are dropped.
A rule based method (e.g. regular expression: word[-_/]word) would allow basicallythe extracion of base and quote for any pair, without any maintenance required.
The text was updated successfully, but these errors were encountered:
Hey @firepol ,
good thinking!
The classes like ETHBTCFormatter were created for convenience, in order to have some commonly occurring pairs already provided as a formatter object.
I like the idea of extending the str class, though. If you'd like to submit a PR for this, I'd be happy to have a look at it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I get the idea of this project, to have standardized methods and also standardized responses.
I also like the idea to standardize the pairs, as one exchange uses BTCUSD, another BTC/USD, another btcusd etc. which is quite a mess...
What is a bit strange to me, is to have classes for pairs. I don't understand why should I use a "strong type" for something that basically is a string. I also see that in some interfaces the formatting is a bit weird and doesn't really look useful, I mean e.g.
I saw his kind of try/catch in several interfaces and I was wondering why was it like that, then I tested and noticed, that if I pass a string for the pair, it raises an exception, which was not really expected...
Why not having an extension format_for method for string, instead?
This can be handy for exchanges with hundreds of pairs, like binance, bittrex. Creating all pairs as objects is not really necessary on my opinion, not even if you can automate this, as every day there are new pairs...
Ideally the formatter should convert a standard string in a string that the exchange wants.
I'd just have a formatting method expecting one of those standard way:
BASE-QUOTE, where "-" could be a different separator, like /, _ etc. like this it wouldn't be needed to create hundred of classes like this one:
This looks hard to maintain, especially if you think that every week there are new pairs added to exchanges like binance, and sometimes some pairs are dropped.
A rule based method (e.g. regular expression: word[-_/]word) would allow basicallythe extracion of base and quote for any pair, without any maintenance required.
The text was updated successfully, but these errors were encountered: