Recent Posts

Thursday, October 13, 2016

Launching Open Source Code Libraries

Chart: Bond Price Figure Generated by Python Libraries
Figure generated by Python library code
I have created a basic fixed income pricing package in the Python programming language -- the "simplepricers" package, available at Github: https://github.com/brianr747/SimplePricers . The code is open source, but the package is now extremely small -- so far, I have spent a lot of time developing my work flow. This package will be used to do fixed income analysis in my books -- and readers will be able to use the source code to replicate the results. For those of you with an interest in economics, I want to package my Stock-Flow Consistent model code in another open source library.

Requirements

  • Python 3.x [Absolutely required!] I developing on machines with versions 3.3, 3.4, and 3.5 of Python. If you wanted to try it on Python 2.X, you might be able to get much of the code to work. (The print syntax has changed.)
  • Git. [Extremely useful]. The Git source control system is the most natural way of working with this package. Once installed, you can work with a copy of the code package ("clone the repository" in Git-speak). (The Subversion source control system can link to Github as well.) If you do not want to install Git, you can download the source files in a zip file from the GitHub site.
  • Python Library Matplotlib [Useful for examples]. The matplotlib package was used to generate the figure above. Matplotlib has a lot of useful stuff for this type of work, but it has a lot of dependencies. (My first attempts to install failed on various computers.) You can run my example code without matplotlib, but you will not see the figure. If you use another plotting package, you can substitute matplotlib easily.
  • PyCharm. [Useful.] This is an integrated development environment for Python; very useful. There is a free community edition, and a paid professional version.
  • Knowledge of Python, or at least a "learn to program Python" book.
I have created a new blog - http://romanchuk-programming.blogspot.ca/ where I will stick things like installation instructions. That site is expected more to be a set of fixed resource pages than a blog. It might migrate to a sub-domain of bondeconomics.com.

And for those who want a more lighthearted approach to Python, I have started working on a "4X" strategy game ("eXplore, eXpand, eXploit, and eXterminate") - https://github.com/brianr747/Simple4Xpygame

At present, it is not too much of a game - you can watch the AI players try to take over the galaxy. That program uses version 2.7 of Python, and the code is frankly a mess.

Future Developments

I plan to slowly add functionality to the "simplepricers" package as I create examples to illustrate points in articles. A lot of it will be primers, but also topical comments.

Although the final editing process for "Abolish Money!" may take a bit longer, I am starting to think about my next projects. One likely possibility will involve me cleaning up my existing Stock-Flow Consistent model code, and using it to illustrate concepts.

Concluding Remarks

If you are already familiar with Python and git, accessing the code will be straightforward. Otherwise, you will need work on their installation, and how to use them. There is a lot of excellent documentation available for them on the internet; I will put some pointers on the other site.


(c) Brian Romanchuk 2016

3 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete

Note: Posts are manually moderated, with a varying delay. Some disappear.

The comment section here is largely dead. My Substack or Twitter are better places to have a conversation.

Given that this is largely a backup way to reach me, I am going to reject posts that annoy me. Please post lengthy essays elsewhere.