question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

From/to unified pair name/exchange specific name

See original GitHub issue

I’d like in unified API having two functions which map from unified names (e.g. BTC/EUR) to market specific name and back (e.g. BTCEUR for kraken IIRC).

This will help me test your library further and detect subtle errors.

I recommend names:

to_market_api_name(self, symbol)
to_unified_name(self, symbol)

They should throw exception of not found in the exchange load products. It should use cached load_products()

This functionality is implemented somewhere anyhow, it’s only about exposing it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kroitorcommented, Jul 15, 2017

Update: It’s in The Manual now.

0reactions
kroitorcommented, Jul 15, 2017

I’ve uploaded the interface to products, product symbols and product ids. Here’s how to use it:

import ccxt
k = ccxt.kraken ()
k.load_products ()

# symbol → product
k.products['BTC/USD']

# id → product
k.products_by_id['XXRPZUSD']

# symbol → id
k.products['BTC/USD']['id']

# id → symbol
k.products_by_id['XXRPZUSD']['symbol']

No functions, basic dictionaries indexed by appropriate fields. The are cached and can be force-reloaded if necessary.

You will get a userland standard Python exception if you access non-existent keys in these dicts. I hope the above solution simplifies the usage, closing this issue down now. Will soon add it to the Manual. Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Namespace Planning in Exchange 2016
Deploy a unified namespace for the site resilient datacenter pair ... As its name implies, in a bound model, users are associated (or...
Read more >
Exchanges — ccxt 2.4.71 documentation
An exchange-specific id of the quote currency, not unified. active . A boolean indicating whether or not trading this market is currently possible,...
Read more >
Configuration Guide for Cisco Unified ICM/Contact Center ...
Must be unique among all objects of a specific type. For example, each service must have an enterprise name that is unique among...
Read more >
Manpage of charraymember - IBM
Name. charraymember. Use the charraymember command to modify an array member's attributes, or to swap a member of a RAID array with that...
Read more >
importrobot - MathWorks
Use the URDF or SDF Import name-value pairs to import a model from URDF, SDF file, or text. Simscape Multibody Model Import. [...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found