Release Trade Dangerous (Est. 2015) Power user's highly configurable trade optimizer

OK, of course I will do that. I'm a bit surprised though, as I had no problems updating the database with version 10.14.2. ...

We changed the database so all the internal numbering of stuff now matches with their FDEV_ID . Thus old data will have all the wrong IDs. This is something that makes life simpler and would have been done by design, if only FDEV_ID had been a useful thing a decade ago, bearing in mind how old TD is.
 
Oliver has been messing (in a good way) with the code. Output is now in COLOUR.

You'll need to install a new python module for this.

From command line

pip install rich
 
Oliver has been messing (in a good way) with the code. Output is now in COLOUR.

You'll need to install a new python module for this.

From command line

pip install rich
TD v10.16.12 and above will automatically install 'rich' for you when you install TD via pip.
 
Last edited:
Boy, we're really cranking out the updates lately, aren't we?

With the recent release of TD v11.0.4, the eddblink import is much faster than it used to be. Everybody celebrate!
 
Hi guys. I'm having no end of problems now. I did a clean install of TD this morning. Took between 2 and 3 hours to complete. This afternoonI have just done a trade import -P eddblink -O listings command. I watched it skip over Systems, Station and Item.csv then download listings.csv from Tromador.com. 2.5GB of gziped data then started processing (it showed Live = false - is that right?). A while later I saw Optimizing database - aha, that's new! Anyway that finished about 75 minutes from when it started processing. Then listings-live.csv was downloaded and started processing (this time Live=true). Optimizing database appeared again and this time completed in 45 minutes. Import completed. Good, a quick test doing a trade run. This failed as no prices file could be found. Sure enough, in my TD\data folder no .prices file. Are you still using tradedangerous.prices to store the prices in? I have a db file of 6.3GB. Are the prices going to be in there?

Here's the output:-

c:\TDAlone>trade import -P eddblink -O listings
NOTE: Checking for update to 'System.csv'.
NOTE: Checking for update to 'Station.csv'.
NOTE: Checking for update to 'Item.csv'.
NOTE: Checking for update to 'listings.csv'.
NOTE: Downloading file 'listings.csv'.
NOTE: Requesting NOTE: Downloaded 2.5GB of gziped data 22.6MB/s
NOTE: Processing market data from listings.csv: Start time = 2024-04-26 14:56:27.655943. Live = False
NOTE: Optimizing database...
NOTE: Finished processing market data. End time = 2024-04-26 16:15:38.246250
NOTE: Checking for update to 'listings-live.csv'.
NOTE: Downloading file 'listings-live.csv'.
NOTE: Requesting NOTE: Downloaded 15.5MB of gziped data 16.3MB/s
NOTE: Processing market data from listings-live.csv: Start time = 2024-04-26 16:15:41.240258. Live = True
NOTE: Optimizing database...
NOTE: Finished processing market data. End time = 2024-04-26 17:00:52.994791
NOTE: Import completed.

Its the first time I've seen this so I don't know if the Live =False or Live = True are relevant. I'm presuming that somewhere, something is blocking the creation of tradedangerouse.prices but don't have a clue what or how!

Any advice gratefully received.
 
Everything in the import went as expected, the "Live = ..." bit is just to verify that it correctly detected if it's improving the live listings or not.

Could you post the log of the "trade run ..." failing on the GitHub in an issue?

Run "trade import -P eddblink -O prices" and it will generate the prices file

Unless you also pass listings, it won't do another import, it'll just make the file

It no longer does it by default to save time on the import process, it seems that may have been a mistake.
 
Last edited:
Hello everyone,
... unfortunately I have problems with the new version(s). I have updated the latest versions via "pip install --upgrade tradedangereous" (currently v 11.0.5).
This process worked without any problems. Unfortunately, I always get errors when I want to create a new database or update an older one (backup of my last working one).
I normally use the TD-Helper. But even without TD-Helper, when I run the command "trade.py import -P eddblink -O all", I get the error messages.
What am I doing wrong?
Code:
c:\Users\Flitzipaldi\Desktop\TDH>trade import -P eddblink -O all
NOTE: Checking for update to 'Upgrade.csv'.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\trade.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\trade.py", line 40, in main
    cli.main(sys.argv)
  File "C:\Python311\Lib\site-packages\tradedangerous\cli.py", line 66, in main
    trade(argv)
  File "C:\Python311\Lib\site-packages\tradedangerous\cli.py", line 121, in trade
    results = cmdenv.run(tdb)
              ^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\commands\commandenv.py", line 84, in run
    return self._cmd.run(results, self, tdb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\commands\import_cmd.py", line 124, in run
    if not plugin.run():
           ^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\plugins\eddblink_plug.py", line 452, in run
    if self.downloadFile(self.upgradesPath) or self.getOption("force"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\plugins\eddblink_plug.py", line 182, in downloadFile
    dumpModded = datetime.datetime.strptime(url_time, "%a, %d %b %Y %H:%M:%S %Z").timestamp()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data 'Sat, 27 Apr 2024 02:42:34 GMT' does not match format '%a, %d %b %Y %H:%M:%S %Z'

Translated with DeepL.com (free version)
 
Hi Nepomuk, On GitHub, I was advised to empty my TD\data folder and run " trade import -P eddblink -O clean" which should fix things. Its worth a try.
 
Thanks for the tip. Unfortunately, this did not help me. I have emptied the data directory, but I get the same error message list.

Code:
c:\Users\Flitzipaldi\Desktop\TDH>trade import -P eddblink -O clean
NOTE: Rebuilding cache file: this may take a few moments.
NOTE: Missing "C:\Users\Flitzipaldi\Desktop\TDH\data\TradeDangerous.prices" file - no price data.
NOTE: Checking for update to 'Upgrade.csv'.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\trade.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\trade.py", line 40, in main
    cli.main(sys.argv)
  File "C:\Python311\Lib\site-packages\tradedangerous\cli.py", line 66, in main
    trade(argv)
  File "C:\Python311\Lib\site-packages\tradedangerous\cli.py", line 121, in trade
    results = cmdenv.run(tdb)
              ^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\commands\commandenv.py", line 84, in run
    return self._cmd.run(results, self, tdb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\commands\import_cmd.py", line 124, in run
    if not plugin.run():
           ^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\plugins\eddblink_plug.py", line 451, in run
    if self.downloadFile(self.upgradesPath) or self.getOption("force"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\tradedangerous\plugins\eddblink_plug.py", line 181, in downloadFile
    dumpModded = datetime.datetime.strptime(url_time, "%a, %d %b %Y %H:%M:%S %Z").timestamp()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data 'Sat, 27 Apr 2024 02:42:34 GMT' does not match format '%a, %d %b %Y %H:%M:%S %Z'
 
Try updating python? I don't know, I can't reproduce your error.

All I can say is that 'Sat, 27 Apr 2024 02:42:34 GMT' most certainly DOES match the format.
 
Last edited:
OK, I have updated the Python version to 3.12.3-amd64. Python is installed here: c:\python312
My data directory is here: c:\Users\UserName\Desktop\TDH\data\

Code:
Command line:  import -P eddblink -O clean
NOTE: Rebuilding cache file: this may take a few moments.
NOTE: Missing "C:\Users\Flitzipaldi\Desktop\TDH\data\TradeDangerous.prices"
NOTE: Checking for update to 'Upgrade.csv'.
file - no price data.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python312\Scripts\trade.exe\__main__.py", line 7, in <module>
  File "C:\Python312\Lib\site-packages\trade.py", line 40, in main
    cli.main(sys.argv)
  File "C:\Python312\Lib\site-packages\tradedangerous\cli.py", line 66, in main
    trade(argv)
  File "C:\Python312\Lib\site-packages\tradedangerous\cli.py", line 121, in trade
    results = cmdenv.run(tdb)
              ^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\tradedangerous\commands\commandenv.py", line 84, in run
    return self._cmd.run(results, self, tdb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\tradedangerous\commands\import_cmd.py", line 124, in run
    if not plugin.run():
           ^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\tradedangerous\plugins\eddblink_plug.py", line 451, in run
    if self.downloadFile(self.upgradesPath) or self.getOption("force"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\tradedangerous\plugins\eddblink_plug.py", line 181, in downloadFile
    dumpModded = datetime.datetime.strptime(url_time, "%a, %d %b %Y %H:%M:%S %Z").timestamp()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\_strptime.py", line 554, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\_strptime.py", line 333, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data 'Sat, 27 Apr 2024 02:42:34 GMT' does not match format '%a, %d %b %Y %H:%M:%S %Z'

Command completed.
 
Last edited:
%aAbbreviated weekday name.Sun, Mon, ...
%dDay of the month as a zero-padded decimal.01, 02, ..., 31
%bAbbreviated month name.Jan, Feb, ..., Dec
%YYear with century as a decimal number.2013, 2019 etc.
%HHour (24-hour clock) as a zero-padded decimal number.00, 01, ..., 23
%MMinute as a zero-padded decimal number.00, 01, ..., 59
%SSecond as a zero-padded decimal number.00, 01, ..., 59
%ZTime zone name.

'Sat, 27 Apr 2024 02:42:34 GMT'
'%a, %d %b %Y %H:%M:%S %Z'

The string matches the pattern. I don't know what is wrong with your python installation.
 
Sorry, but what can I do to help? I am not familiar with “Python” at all. Everything worked until recently.
Win10 - German
 
Last edited:
Ok.
...
... unpacked and started. Data is requested and downloaded. The only error or “missing” is the TradeDangerous.prices file (but this was to be expected). (y):)

1714300009359.png
 
Last edited:
Hello everyone, a question:

I use the TD-Helper (GUI for TD). I have noticed that, for example, when using the ‘sell’ function (I want to sell to a station), the displayed list can only be sorted by "price" and "stock" (why? wouldn't "demand" be better?). A ‘switch’ for the "price age" is also missing and also "distance".
Now my question: Do you, @eyeonus, also process this or not, or is another CMDR involved in the tool? Then I would open a ticket at github.

Greetings nepomuk

Translated with DeepL.com (free version)
 
eyeonus - i constantly get errors when using tradedangerous.
most of them are like this:
C:\python3.7.4\Scripts\trade: D:\games\_utils\_elited\TDHelper-v3.1.1.0\data\TradeDangerous.prices:4985377 ERROR Second occurrance of station "HR 1183/RESCUE SHIP - ARC'S FAITH", previous entry at line 4985266.
usually about 90% of them....
is there something im doing wrong?
the only way to fix this - is to completely redownload the DB "clean" and start over.
which is obviously not a good thing to have to do every single day....
 
Back
Top Bottom