In-Development TradeDangerous: power-user trade optimizer

You need to download item.csv from maddavo's website. There are some new commodities in Horizons.

- - - - - Additional Content Posted / Auto Merge - - - - -

Do prices that I add to my local db and then upload to maddavo, make it across to EDDN?

I replaced the item.csv from maddavo's website. It still is giving me the error.
 
I have created a "horizon" branch with "planetary" support in my bitbucket repo:
Code:
Added "planetary" column to station table and maddavo import.
Added "--planetary" argument to station command.
Added "--no-planet" switch to buy, local, nav, rares, run and sell command.
Added "Plt: X" output.

I havn't tested it much. You can try it out if you want.

edit: https://bitbucket.org/bgol/tradedangerous

Awesome!

FYI, I've pushed 3.6.0 of the EDAPI plugin for the new ships, commodities, and it will prompt for the new "planetary" flag in gazelle's branch.

https://bitbucket.org/orphu/edapi
 
Updated with the new repository, grabbed items from maddavo... also still getting the large scroll of unrecognized item errors. Alien51 - can you point to what files you pulled from Gazelle, and perhaps where they were?

Thanks.
 
If you have checked out my repository you'll also need to switch to the "horizon" branch. The "master" branch is still in sync with the original (kfsone) one.

Code:
$ git clone https://bgol@bitbucket.org/bgol/tradedangerous.git
$ cd tradedangerous
$ git checkout horizon

Or download the "Item.csv" from maddavo, place it in the data directory and rebuild the cache.
Code:
$ cd tradedangerous/data (or wherever)
$ wget http://www.davek.com.au/td/Item.csv
$ cd ..
$ ./trade.py buildcache -fi
 
Updated with the new repository, grabbed items from maddavo... also still getting the large scroll of unrecognized item errors. Alien51 - can you point to what files you pulled from Gazelle, and perhaps where they were?

Thanks.

I copied over the files in data and buildcache -fi after that I updated and it don't seem to come up with unrecognized error anymore. The original files from TD seems to give me the error no matter what I do. I still don't know the root cause but seems to fix it when I do that. I even tested by swapping out the files with the original to update and gives me the error again.
 
Thanks, gazelle! Pulling the file off maddavo and rebuilding the cache did the trick.

You guys are absolute rock stars for keeping all this running!!!
 
I've just flown some rares by an economical route calculated in the game.

Along the way I've discovered 10 systems that are not in system.csv.

In some cases they are already in EDSM, in other cases I have added them, and snafued the co-ordinates.

I know how to add these to my local system.csv, but what's the best way to share them with everybody else?
 
I think maddavo is an established source for TD data.

You may send him the new systems per PM and he may include them into his System.csv file download. The maddavo plugin does also support system updates (as option) as well.
 
What does this branch offer, and how can I get hold of it please (preferably as a download rather than all this GitHub business)?

It's a "planetary" extension of TD. Stations do get a field "planetary" and you can use the switch "--no-planet" to avoid stations on planets.

You can go to the Download page on bitbucket, select "Branches" and click on the "zip" link (in the download column on the right) of the "horizon" line. This will give you the code you can place into its own subdir and use it like the original TD.

Changelog:
  • Don't merge the prices form maddavo anymore (use --merge-import if you need it).
  • New items with version 1.5/2.0 of ED
  • data update from maddavo
  • Added "planetary" column to station table and maddavo import.
  • Added "--planetary" argument to station command.
  • Added "--no-planet" switch to buy, local, nav, rares, run and sell command.
  • Added "Plt: X" output.
  • Update EDAPI plugin to version 3.6.0
 
Last edited:
Tested that Horizon branch. All things working normal exept edapi_plug.py

Code:
[FONT=monospace][COLOR=#000000]python3 plugins/edapi_plug.py  [/COLOR]
Traceback (most recent call last):
  File "plugins/edapi_plug.py", line 7, in <module>
    import cache
ImportError: No module named 'cache'
[/FONT]

I have Kubuntu 15.10 with python 3.5
 
Tested that Horizon branch. All things working normal exept edapi_plug.py

Code:
python3 plugins/edapi_plug.py
Traceback (most recent call last):
  File "plugins/edapi_plug.py", line 7, in <module>
    import cache
ImportError: No module named 'cache'

I have Kubuntu 15.10 with python 3.5

Take a look at the readme on how to use plugins.

Like this:

python3 trade.py imp -P edapi -O eddn
 
Last edited:
Hello,

Thank you for all your effort.

I have just gotten the latest 1.5/Horizons branch and copied the files over the old TD files.
I tried using Python 3.5.1 and then now Python 3.4.4.

With the old Trade.py and the new Trade.py and with both Python 3.5.1 and 3.4.4, I keep getting this error:
Code:
Command line: -u "F:\Frontier\Trade\TD\trade.py" import --plug=maddavo --opt=usefull,force
ERROR: Unable to load the Python 'requests' package.
Traceback (most recent call last):
This often happens if you have bits of 32-bit and 64-bit Python installed.
  File "F:\Frontier\Trade\TD\trade.py", line 104, in <module>
Consider using control panel to uninstall Python, delete the Python folder (usually C:\Python34\) and re-install Python.
    main(sys.argv)

  File "F:\Frontier\Trade\TD\trade.py", line 77, in main
    results = cmdenv.run(tdb)
  File "F:\Frontier\Trade\TD\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "F:\Frontier\Trade\TD\commands\import_cmd.py", line 124, in run
    if not plugin.run():
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 721, in run
    self.import_prices()
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 584, in import_prices
    self.download_prices(lastRunDays)
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 567, in download_prices
    shebang=lambda line: self.check_shebang(line, True),
  File "F:\Frontier\Trade\TD\transfers.py", line 125, in download
    requests = import_requests()
  File "F:\Frontier\Trade\TD\transfers.py", line 47, in import_requests
    "I can try and install the package automatically using 'pip'.\n"
RuntimeError: input(): lost sys.stdin

Finished updating using all available data from Maddavo.
Command line: -u "F:\Frontier\Trade\TD\trade.py" import --plug=maddavo --opt=use2d,force
Traceback (most recent call last):
ERROR: Unable to load the Python 'requests' package.
  File "F:\Frontier\Trade\TD\trade.py", line 104, in <module>
This often happens if you have bits of 32-bit and 64-bit Python installed.
    main(sys.argv)
Consider using control panel to uninstall Python, delete the Python folder (usually C:\Python34\) and re-install Python.
  File "F:\Frontier\Trade\TD\trade.py", line 77, in main

    results = cmdenv.run(tdb)
  File "F:\Frontier\Trade\TD\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "F:\Frontier\Trade\TD\commands\import_cmd.py", line 124, in run
    if not plugin.run():
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 721, in run
    self.import_prices()
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 584, in import_prices
    self.download_prices(lastRunDays)
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 567, in download_prices
    shebang=lambda line: self.check_shebang(line, True),
  File "F:\Frontier\Trade\TD\transfers.py", line 125, in download
    requests = import_requests()
  File "F:\Frontier\Trade\TD\transfers.py", line 47, in import_requests
    "I can try and install the package automatically using 'pip'.\n"
RuntimeError: input(): lost sys.stdin

Finished updating using all available data from Maddavo.
Command line: -u "F:\Frontier\Trade\TD\trade.py" import --plug=maddavo --opt=use3h,force,csvs
NOTE: Importing Corrections
ERROR: Unable to load the Python 'requests' package.
Traceback (most recent call last):
This often happens if you have bits of 32-bit and 64-bit Python installed.
  File "F:\Frontier\Trade\TD\trade.py", line 104, in <module>
Consider using control panel to uninstall Python, delete the Python folder (usually C:\Python34\) and re-install Python.
    main(sys.argv)

  File "F:\Frontier\Trade\TD\trade.py", line 77, in main
    results = cmdenv.run(tdb)
  File "F:\Frontier\Trade\TD\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "F:\Frontier\Trade\TD\commands\import_cmd.py", line 124, in run
    if not plugin.run():
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 710, in run
    self.import_corrections()
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 173, in import_corrections
    for src, oldName, newName in stream:
  File "F:\Frontier\Trade\TD\plugins\maddavo_plug.py", line 132, in csv_stream_rows
    for _, values in transfers.CSVStream(url, tdenv=self.tdenv):
  File "F:\Frontier\Trade\TD\transfers.py", line 261, in __init__
    requests = import_requests()
  File "F:\Frontier\Trade\TD\transfers.py", line 47, in import_requests
    "I can try and install the package automatically using 'pip'.\n"
RuntimeError: input(): lost sys.stdin

Finished updating using all available data from Maddavo.

Help please.

Thank you and best regards.
 
Does this mean I should not use trade.py import --plug=maddavo anymore?

The key part of the change in import behaviour is "don't merge".
It is important to understand what the import command does and what has been changed.

There are two ways price data can be imported - I will call them "merging" and "clobbering". A merge import means that if there is existing price data for a station then any newer data will be updated into the database and still leave any data for other commodities not in the new data. A clobbering import will delete any data for a station first and then replace it with the new station data. The problem with a merge import is that it leaves old items at a station when they are no longer traded there - eg if the station changes owners then the items can change in the market. For our purposes, the clobbering import is what we want. Originally the import command was clobbering, then it was changed to merging. Gazelle's code changes it back to clobbering.

You still use the plugin the same way as always. You will just find that you are less likely to be sent somewhere to trade something that isn't there - which clearly is a good thing. :)
 
Last edited:
With the old Trade.py and the new Trade.py and with both Python 3.5.1 and 3.4.4, I keep getting this error:
Code:
Command line: -u "F:\Frontier\Trade\TD\trade.py" import --plug=maddavo --opt=usefull,force
ERROR: Unable to load the Python 'requests' package.

You need the "requests" package to be installed. Try this command:
Code:
pip install --upgrade requests
 
Last edited:
Back
Top Bottom