Package: tradingconv
tradingconvAre you trading with Cryptocurrencies onBinance? Do you need a tool to manage the different file formats platforms
like Binance uses for exporting the trading history, e.g. to import into tax return software or for tracking your
portfolie indelta?This package provide the appropriate tools for handling different formats of trading history files. Furthermore, the
Binance API limitation that allows to only export trading history in an three month interval is lifted so that you can
export yourfulltrading history. No need to generate an API key and expose it to third-party applications. Just
use you local login session.InstallationThis package is hosted onPyPIso just installtradingconvwithpip install tradingconvCommandsThis package comes equipped with multiple tools. Here is a list of currently available tools.CommandDescriptionbinancecrawlerQuery Binance to export thefulltrade historytradingconvConvert supported (csv,xlsx) files into other supported formatsQuery BinanceDespite using the official API of Binance which limits the trade history to the last three month,binancecrawleris able to retrieve and export thefulltrade history.Therefore,binancecrawlerrequires the session cookies of an active Binance connection on the current machine.
The parameter--cookiesshould therefore point to a file containing a string with the cookies.
)Save Binance sessionIn order to retrieve the Cookies of an active Binance session, log in into Binance and export the Cookies.
I've setup a list of links with a description on how to do this for different browser.ChromeFirefoxTo the best of my knowledge, the following cookies are currently required in order to gain access to the active
session:JSESSIONID__BINANCE_USER_DEVICE_ID__Save all of theses variables into a file with only one line in the following format:line:=<var>+ <EOL>
var:=<variable>=<value>;
<variable> = "JSESSIONID" | "__BINANCE_USER_DEVICE_ID__ "With<value>as the value of the variable. A line thus looks like:JSESSIONID=<value>;__BINANCE_USER_DEVICE_ID__<value>Finally, we need an additional csrftoken Binance uses for internal queries. You can read this token out by switching to
your account page, open the development console of you browser (the one where you've copied the cookies from) and search
for an entrygetUserLoginLog.html. You'll find the csrftoken in the header of the message.Retrieve trade historyNow you can query Binance to retrieve your trade history within a specific inverval withbinancecrawler --cookies <cookie_file> --token <csrftoken> --start "2018-01-01 00:00:00" --end "2018-01-02 00:00:00" --output trade_file.csvor simply the full history by passing a start some time ago your account creation.binancecrawler --cookies <cookie_file> --token <csrftoken> --start "2000-01-01 00:00:00" --output full_trade_file.csvConvert to other formatsTo finally convert csv or xlxs files to the other csv or xlsx format,tradingconvdoes the trick.The following source formats are supported:bitpanda: From the export function of the Bitpanda websitebinance: From the export function on the Binance websitebinancecrawler: The csv file created bybinancecrawlerThe following output formats are supported:binance: The xlsx format used by Binance.delta: The csv file format used by Delta.More formats may supported in the future.So, to convert the full trade history exported bybinancecrawlerto the delta format, simply call:tradingconv --format delta --file full_trade_file.csv --output delta_trades.csvThanksIf you like this tool, donate some bugs 💸 for a drink or two at the ETH-Wallet0xbbf40ba9f8de33061ebd9eecafc0c4b2081ad14for viaPayPal. Cheers 🍻!LicenseThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, seehttp://www.gnu.org/licenses/.