Skip to content
TORNLIFE More

Python: Download UserLog & Analyse Trades

Started by PinkFish [3515024] on in Tools & Userscripts.

1 replies · 61 views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 2 / 2 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
2
Discussion span
→
People posting
2
Likes on archived posts
3
Authority score
34 / 100
Historical score
13 / 100
Story score
24 / 100
Engagement score
40 / 100
PinkFish [3515024]

This Python script will download your userlog into a local SQLite database which you can then query yourself or you can export to CSV using the Python export script.  

 

https://github.com/DancingLettuce/pytorn 

 

Run the script with  python3 readlog.py . First time it is run give it your private API key like this python3 readlog.py --apikey myapikey Next time it runs it will work backwards from the to download all the missing logs since the last time it was run.  You can give it a unix timestamp to go back too for historical analysis.

 

Then you can export the user logs python3 sqlitetohtml.py --sqlprepared trading --outfile trading.csv  and analyse them in a sheet.  

 

I wrote this before I found out about Torn PDA, TornPal or the other scripts which are more useful, but I left in the code to read a specific user details and put all the user details and all the bazaar into a table too.

 

 

The script uses your private API key and it should throttle your API calls.  It does not share your key.  You will need to install the Python dependencies for SQLite and requests.