Tagged "python"

HomeAssistant Yellow Review

For Christmas as a gift to myself I bought a HomeAssistant Yellow. If you’re not familiar with HomeAssistant - it’s a one-stop-shop to control all your smart lights, plugs, sensors and anything else in your smart home. HomeAssistant is the software part and as it’s open source you can freely install it on any computer you have. In fact many people install HomeAssistant on a Raspberry Pi. HomeAssistant Yellow is their own custom hardware with a built in chip for Zigbee (and now Threads) protocol, along with Bluetooth, WiFi and audio out.

Convert Bank Transactions XLS to CSV in Python

I’ve written previously on importing transactions to hledger/ledger from KBC bank in JavaScript and PTSB bank in Python. I took different approaches to each: For KBC, you needed to log in and run Javascript which scrape the transaction table and download it formatted as CSV For PTSB, the script automatted logging in, get the transaction table and save locally as CSV Both approaches are valid - but suffer from the same issues: any change the bank makes to it website needs to be updated in the code.

Python 3 In-Memory Zip File

In Python, BytesIO is the way to store binary data in memory. Most examples you’ll see using zip files in memory is to store string data and indeed the most common example you’ll find online from the zipfile module is zipfile.writestr(file_name, "Text Data"). But what if you want to store binary data of a PDF or Excel Spreadsheet that’s also in memory? You could use zipfile.write() (designed to take binary data) but then you can’t specify a filename (since our in-memory file was never written to a location on disk).

Scraping Data from your Bank in Python

As part of my previous posts, I talked about ledger and plain text accounting. The only part missing is that you need a method to import transactions from your bank. For this I have been doing this by hand, bi-weekly. I would have to do the following: Log in to online banking Go to the transactions page Select the date range for transactions I needed (double check last date of transaction in ledger at this point) Download the Microsoft Excel format file that wasn’t in the proper format Convert this Excel file into a CSV file that matched my import format (watch the dates, is it YYYY-MM-DD or DD/MM/YYYY?

Fill hours worked in SAP Netweaver Automatically

Continuing the theme of automation, one of the most repetitive tasks if you work for a big company is timesheets. So I set out to rectify this by scripting it! Start with you configuration, I named mine hours.ini: [DEFAULT] url = FILL_ME_IN username = FILL_ME_IN password = FILL_ME_IN then we need the magic of Selenium to do the heavy lifting, so we install it: $ pip3 install selenium I called this script, unsurprisingly hours.