1
0
Fork 0

Upload files to 'output'

This commit is contained in:
tom 2022-12-05 22:01:52 +00:00
parent e3b7facbda
commit 6ec2396ccc
1 changed files with 106 additions and 78 deletions

View File

@ -1,5 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Corax FM</title><link href="https://coraxfm.uk/" rel="alternate"></link><link href="https://coraxfm.uk/feed.rss" rel="self"></link><id>https://coraxfm.uk/</id><updated>2022-06-14T00:00:00+01:00</updated><entry><title>Take Your Accounts Offline</title><link href="https://coraxfm.uk/take-your-accounts-offline.html" rel="alternate"></link><published>2022-06-14T00:00:00+01:00</published><updated>2022-06-14T00:00:00+01:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2022-06-14:/take-your-accounts-offline.html</id><summary type="html">&lt;p&gt;Take your accounts out of the cloud and back onto your own computer&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a huge push accross the accounting industry to push accounts into the cloud. You can find no end of articles that sell the benefits of moving your accounts online and into "the cloud" (&lt;a href="https://www.xero.com/uk/guides/small-business-cloud-accounting/"&gt;here&lt;/a&gt;, &lt;a href="https://quickbooks.intuit.com/uk/blog/cloud-accounting-top-benefits/"&gt;here&lt;/a&gt;, &lt;a href="https://www.accountingweb.co.uk/community/industry-insights/the-benefits-of-cloud-accounting"&gt;here&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?t=ffab&amp;amp;q=cloud+accounting+benefits&amp;amp;ia=web"&gt;and many more&lt;/a&gt;).&lt;/p&gt;
<feed xmlns="http://www.w3.org/2005/Atom"><title>Corax FM</title><link href="https://coraxfm.uk/" rel="alternate"></link><link href="https://coraxfm.uk/feed.rss" rel="self"></link><id>https://coraxfm.uk/</id><updated>2022-12-05T00:00:00+00:00</updated><entry><title>Exchange Rates in Netsuite</title><link href="https://coraxfm.uk/exchange-rates-in-netsuite.html" rel="alternate"></link><published>2022-12-05T00:00:00+00:00</published><updated>2022-12-05T00:00:00+00:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2022-12-05:/exchange-rates-in-netsuite.html</id><summary type="html">&lt;p&gt;How do foreign currency translations work in Netsuite&lt;/p&gt;</summary><content type="html">&lt;p&gt;Netsuite is one of my favourite ERP programs for finance. It has great reporting, is relatively easy to use, and looks good too. Where I have found that it really excels is when it is the only finance system of a group of companies. It works really well consolidating results up to a group level. However, it can get a bit confusing how it translates currencies especially with consolidation.&lt;/p&gt;
&lt;p&gt;Netsuite performs translations at two different stages: on the transaction and on consolidation. Netsuite holds a daily transaction rate, and three consolidated rate (current, average, historical).&lt;/p&gt;
&lt;h2&gt;Transactions&lt;/h2&gt;
&lt;p&gt;Each subsidiary has a reporting currency. Any foreign currency transaction is translated into the reporting currency on the date of the transaction. Balances get translated at the rate on last day of the reporting period.&lt;/p&gt;
&lt;p&gt;When running non-consolidated financial statements for a given subsidiary, Netsuite will give you the results in the reporting currency of the subsidiary.&lt;/p&gt;
&lt;h2&gt;Consolidation&lt;/h2&gt;
&lt;p&gt;Netsuite has one single subsidiary which is the top of the consolidation tree. The reporting currency of this entity is dictated by the edition that you use. For example, UK Netsuite uses GBP.&lt;/p&gt;
&lt;p&gt;Consolidated rates are calcluated as part of the period close process. There are three types:
- Current - This is the closing rate for the period (Usually used for Stock)
- Average - Average rate for the period
- Historical - The average rate for the whole history of the account. (Usually used for Equity, Fixed Assets)&lt;/p&gt;
&lt;p&gt;Each nominal code has an exchange rate set on it to tell Netsuite how to translate it according to one of the three methods above. Ultimately, all your subsidiaries regardless of their reporting currency will consolidate up to the currency of the lead subsidiary.&lt;/p&gt;
&lt;h2&gt;Calculations&lt;/h2&gt;
&lt;p&gt;To get consolidated financial statements, Netsuite first translates transactions into the reporting currency of the subsidary. Then translates the whole financial statement into the reporting currency of the lead subsidiary.&lt;/p&gt;
&lt;p&gt;On the whole, consolidated rates and daily exchange rates should match, however, sometimes they may not. Netsuite can automatic rates from either HSBC or Xignite. These do not triangulate, the inverse of an exchange rate is not always 1/n. This can lead to a situation where a GBP transaction in a USD entity, could be a different GBP value when consolidated. The fx variance is a small number, but on big transsactions can make a big difference....&lt;/p&gt;
&lt;h2&gt;Cumulative Translation Reserve&lt;/h2&gt;
&lt;p&gt;When consolidatding a trial balance, balance sheets will end up imbalanced. This is due to the different exchange rates (current, average, historical) being used. The balancing figure on consolidation ends up going to the cumulative translation adjustment. Have enough exchange volatility and this can be a big number too.&lt;/p&gt;
&lt;p&gt;Netsuite does not post a journal for the cumulative translation adjustment, it calculates it when running financial statements.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Exchange rates can be pretty complex, here is a list of things to note:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Netsuite has two types of exchange rate: daily rates and consolidated rates.&lt;/li&gt;
&lt;li&gt;Daily rates come from HSBC or Xignite&lt;/li&gt;
&lt;li&gt;Daily rates don't always work both ways. EUR-&amp;gt;GBP is not the same as GBP-&amp;gt;EUR&lt;/li&gt;
&lt;li&gt;Consolidated rates are calculated from daily rates&lt;/li&gt;
&lt;li&gt;Consolidated rates are three different types (current, average, historical)&lt;/li&gt;
&lt;li&gt;Translation formula = transaction * daily fx rate * consolidated rate&lt;/li&gt;
&lt;li&gt;Cumlative translation adjustment is the value of the imbalance caused on consolidation&lt;/li&gt;
&lt;/ul&gt;</content><category term="articles"></category><category term="Accounting"></category><category term="Netsuite"></category></entry><entry><title>Take Your Accounts Offline</title><link href="https://coraxfm.uk/take-your-accounts-offline.html" rel="alternate"></link><published>2022-06-14T00:00:00+01:00</published><updated>2022-06-14T00:00:00+01:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2022-06-14:/take-your-accounts-offline.html</id><summary type="html">&lt;p&gt;Take your accounts out of the cloud and back onto your own computer&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a huge push accross the accounting industry to push accounts into the cloud. You can find no end of articles that sell the benefits of moving your accounts online and into "the cloud" (&lt;a href="https://www.xero.com/uk/guides/small-business-cloud-accounting/"&gt;here&lt;/a&gt;, &lt;a href="https://quickbooks.intuit.com/uk/blog/cloud-accounting-top-benefits/"&gt;here&lt;/a&gt;, &lt;a href="https://www.accountingweb.co.uk/community/industry-insights/the-benefits-of-cloud-accounting"&gt;here&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?t=ffab&amp;amp;q=cloud+accounting+benefits&amp;amp;ia=web"&gt;and many more&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Cloud accounting is great for lots of use cases. However, there are some risks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reliance on the external provider - A cloud provider could terminate your service or there could be outages.&lt;/li&gt;
@ -111,8 +139,8 @@ with open(xero_export, 'r') as input_file:
&lt;th&gt;Nominal&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
@ -121,16 +149,16 @@ with open(xero_export, 'r') as input_file:
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Cash&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;I&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;I&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Payables&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;I&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;I&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -142,8 +170,8 @@ with open(xero_export, 'r') as input_file:
&lt;th&gt;Nominal&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
@ -152,16 +180,16 @@ with open(xero_export, 'r') as input_file:
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Payables&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;J&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;J&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Energy Usage&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;J&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;J&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -173,8 +201,8 @@ with open(xero_export, 'r') as input_file:
&lt;th&gt;Nominal&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
@ -183,48 +211,48 @@ with open(xero_export, 'r') as input_file:
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Water&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;X&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;X&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Water&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-X&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-X&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Gas&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;Y&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;Y&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Gas&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-Y&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-Y&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Elec&lt;/td&gt;
&lt;td&gt;kWh&lt;/td&gt;
&lt;td align="right"&gt;Z&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;Z&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Elec&lt;/td&gt;
&lt;td&gt;kWh&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-Z&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-Z&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -233,45 +261,45 @@ with open(xero_export, 'r') as input_file:
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Jan 31&lt;/td&gt;
&lt;td align="right"&gt;1000&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1000&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Feb 01&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-1000&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-1000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Feb 29&lt;/td&gt;
&lt;td align="right"&gt;1200&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 01&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-1200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-1200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 31&lt;/td&gt;
&lt;td align="right"&gt;1350&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1350&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 01&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-1350&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-1350&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 30&lt;/td&gt;
&lt;td align="right"&gt;1600&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1600&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -283,21 +311,21 @@ Screenshow from entries in Gnucash:
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Period&lt;/th&gt;
&lt;th align="right"&gt;Usage (m^3)&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Usage (m^3)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Feb&lt;/td&gt;
&lt;td align="right"&gt;200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar&lt;/td&gt;
&lt;td align="right"&gt;150&lt;/td&gt;
&lt;td style="text-align: right;"&gt;150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr&lt;/td&gt;
&lt;td align="right"&gt;250&lt;/td&gt;
&lt;td style="text-align: right;"&gt;250&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -381,34 +409,34 @@ Gnucash Income statement:
returns result
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;another_function&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
&lt;span class="nv"&gt;this&lt;/span&gt; &lt;span class="nv"&gt;function&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;different&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;above&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;result&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;another_function&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;this&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;different&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;above&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;result&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Variables&lt;/h2&gt;
&lt;p&gt;Any one that has taken GCSE maths would have come across variables. It's not a popular subject, but algebra is all variables. A variable is a container. In algebra it is a number, in programming it can be anything. For example, the formula &lt;em&gt;Y = X&lt;sup&gt;2&lt;/sup&gt; + 4&lt;/em&gt; both &lt;strong&gt;Y&lt;/strong&gt; and &lt;strong&gt;X&lt;/strong&gt; are variables. To plot a graph of &lt;strong&gt;Y&lt;/strong&gt;, you would plug values into &lt;strong&gt;X&lt;/strong&gt; and solve for &lt;strong&gt;Y&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here's how you can assign a variable in Python:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# assign a string to a variable called &amp;quot;name&amp;quot;&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;guitar&amp;#39;&lt;/span&gt;
&lt;span class="c1"&gt;# assign a number to a variable&lt;/span&gt;
&lt;span class="n"&gt;strings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="c1"&gt;# assign a list to a variable&lt;/span&gt;
&lt;span class="n"&gt;types&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;electric&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;acoustic&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# assign a string to a variable called &amp;quot;name&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;guitar&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# assign a number to a variable&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# assign a list to a variable&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;types&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;electric&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;acoustic&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Arrays&lt;/h2&gt;
&lt;p&gt;An array is a collection of data. Python has several types. I mainly use lists and dicts.&lt;/p&gt;
&lt;h3&gt;Lists&lt;/h3&gt;
&lt;p&gt;Lists are pretty simple. A list is a series of items that are separated by commas within square brackets. They can contain any data types, and can be mixed.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# list of strings&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;hello&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;this&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;is&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# list of numbers&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;6.7&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# list of variables&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;third&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# mix list&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# list of strings&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;hello&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;this&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;is&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# list of numbers&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;6.7&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# list of variables&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;third&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# mix list&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Dicts / JSON&lt;/h3&gt;
@ -430,9 +458,9 @@ Gnucash Income statement:
&lt;h2&gt;Functions&lt;/h2&gt;
&lt;p&gt;A function is an action that you regularly perform within a script. This saves you time in your code, as you only have to write the thing once. There are lots of built in functions in Python, you will definitely write your own.&lt;/p&gt;
&lt;p&gt;Using the formula from above, we could write it as a function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
&lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Functions start &lt;em&gt;def&lt;/em&gt; then the name of the function followed by brackets and a colon. In the example we can pass a number to the function and the function performs the action. The "return" part means that the function will give the result of the function back. This can be assigned to a variable or something else.&lt;/p&gt;
@ -444,22 +472,22 @@ Gnucash Income statement:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Our &lt;em&gt;solve_y&lt;/em&gt; function can be writted using the in-built power function. It raises any number to the power of another number:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
&lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pow&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;, &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;pow&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In our particular case, it doesn't really make it a lot simpler. However, it a bit clearer from a BODMAS point of view.&lt;/p&gt;
&lt;h3&gt;For Loop&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;For loops&lt;/strong&gt; are used lots. A for loop iterates over an item, assigning each of results to a variable. It's kind of hard for non-programmers to get your head around, however, it very powerful. Here are some examples:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;range&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
... &lt;span class="nv"&gt;i&lt;/span&gt;
...
&lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;range&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
...&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;range(x)&lt;/strong&gt; is a function that returns numbers incremented by 1. The range function starts at 0 by default and will count the number of items. Our for loop will assign the result of the range function to the variable i. This is then displayed on the screen.&lt;/p&gt;</content><category term="articles"></category><category term="Python"></category><category term="Software"></category><category term="Technology"></category></entry><entry><title>API, FTP, WTF!</title><link href="https://coraxfm.uk/api-ftp-wtf.html" rel="alternate"></link><published>2021-01-26T00:00:00+00:00</published><updated>2021-01-26T00:00:00+00:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2021-01-26:/api-ftp-wtf.html</id><summary type="html">&lt;p&gt;Your guide to automation in accounting&lt;/p&gt;</summary><content type="html">&lt;p&gt;Automating your accounting (and other) systems can be great for your business. It can help you get more done and with fewer errors. In order to get something automated, data needs to be retrieved from one and put into another. I wil describe two common methods.&lt;/p&gt;