Skip to content

Running from source

Athanasius edited this page Mar 9, 2021 · 49 revisions

Running from source

You will currently need at least Python 3.7.x to run stable code. In order to run develop you will need Python 3.8.x or higher (3.9.x has had some testing).

  1. On MacOS you will likely need a Python install from the official Python website, rather than using HomeBrew. See #670 Update requirements.txt for MacOS for discussion about this.

  2. You have two choices:

    1. Using a zip of the latest stable source. Download and extract the latest stable source code.

    2. OR Clone and checkout the source using git:

      1. cd <directory you want ot be the parent of the source>
      2. git clone https://github.com/EDCD/EDMarketConnector.git
      3. cd EDMarketConnector
      4. git checkout stable

    As per Contributing.md stable will contain the latest released code, or possibly some extra commits leading up to the next release. If you're feeling slightly braver you could use the main branch source code (or git checkout main) instead which might contain newer code that we consider stable enough for the next release.

    NB: Do not use the master branch, it's almost empty! The name is deprecated and we use main instead.

  3. Ensure you have 'pip' or 'pip3' installed, see Installing pip.

  4. Ensure additional necessary Python modules are installed with pip install -r requirements.txt .

    • Note that on Debian (at least up to and including 10.x aka 'Buster') you'll pip3 install -r requirements.txt .
    • If you get 'command not found' or similar for the 'pip' command then first try: python -m pip --user install pip.
  5. Ensure you have tkinter installed if required (such as on Linux)

    • On Debian / Ubuntu / other Debian derivatives the package you want is python3-tk.
  6. Run this application:

    • Linux: ./EDMarketConnector.py .
    • Mac: python ./EDMarketConnector.py .
    • Windows: EDMarketConnector.py .

Command-line

The command-line program EDMC.py writes the current system and station (if docked) to stdout and optionally writes player status, ship locations, ship loadout and/or station data to file. This program requires that the user has performed setup and verification through the app.

Arguments:

 -h, --help     show this help message and exit
 -v, --version  print program version and exit
 -a FILE        write ship loadout to FILE in Companion API json format
 -e FILE        write ship loadout to FILE in E:D Shipyard plain text format
 -l FILE        write ship locations to FILE in CSV format
 -m FILE        write station commodity market data to FILE in CSV format
 -o FILE        write station outfitting data to FILE in CSV format
 -s FILE        write station shipyard data to FILE in CSV format
 -t FILE        write player status to FILE in CSV format
 -d FILE        write raw JSON data to FILE
 -n             send data to EDDN
 -p CMDR        Returns data from the specified player account

The program returns one of the following exit codes. Further information may be written to stderr.

  1. Success. Note that this doesn't necessarily mean that any requested output files have been produced - for example if the current station doesn't support the facilities for which data was requested.
  2. Server is down.
  3. Invalid Credentials.
  4. Verification Required.
  5. Server is lagging.
  6. I/O or other OS error.