Python Enclosure

Published on 27 August 2021 at 20:55

"Free enterprise cannot be justified as being good for business. It can only be justified as being good for society" - Peter Drucker

 

So in the course of this article I hope to convince you of 3 things,

 

1 Python and code in general is pretty great at least as good as anything "Enterprise Software" produces.

2 if you don't think you can adopt new technology surprisingly you should not talk to IT but talk to HR

3 with 1 and 2 taken together we might agree with Peter Drucker.

 

The Star Ship Enterprise

 

If you went on LinkedIn you could find adverts and white papers on why a range of "Enterprise Level" tools are best for X or Y. Every year CEO's and CTO's will spend millions, the enterprise market in 2018 was estimated to be 38.15 billion and is projected to be worth 71.63 billion by 2026. Source ERP (Enterprise Resource Planning) Software Market Size, Growth | Report, 2026 (fortunebusinessinsights.com).

Now a large bulk of this will be Enterprise level database companies, the Hadoops, Oracles, and amorphous cloud of the worlds backend database solutions is something that let us be honest every company needs; and when you get a slice of the operating costs of every company in the world 71.63 billion may actually be a bit low and with room to grow.

So I wondered how far i could get in building a "Enterprise level" for free in Python. It should be noted I do this to raise discussion on the nature of how businesses utilise data show of Python's capabilities and convince you this tool should be in every business though I do not think just because you can replace a lot of tools with Python means necessarily you should.

Though if I can build a whole stack for free alongside powerful AI tools you would want to know about it surely? It should open up discussion on "Enterprise" in general and why some companies will adopt new technology tools and others wont. 

A limitation I have set myself is use of full libraries Pythons "batteries included" approach to coding means that a library in python can do some very impressive stuff with some minimum commands and some resemble there own sub dialects of the Python language being heavily adapted for speed and written in C for speed.

My hope in this is to convince you of the viability of Open source Python libraries as a great edition to your business.

 

Release the Python

 

So what is Python?

Python is a general purpose interpretive (therefore non compiled) language. Guido van Ross-um developed Python in the late 1980s. The name Python has nothing to do with the snake but was to do with Guido van Ross-um love of the Monty Python series and the design documents called the Zen of Python are peppered with humour and common sense coding mantras you can read it here PEP 20 -- The Zen of Python | Python.org.

A guide to installing Python can be found here Python 3 Installation & Setup Guide – Real Python. Despite being a programming language variants exist like the windows store variant which being designed for students limits access, though if you had real and pressing concerns about security there is the option of creating a Linux virtual machine within windows and installing onto the Linux machine. 

In short methods exist to install Python in ways that will disallow users from doing anything too stupid. Credit has to be given to the real Python team I really cannot add anything to their installation guide other than to point you at it.

More than one method exists to install it on your phone be it Android or Apple. That is right you can use the same programming language to automate your phone as your PC. If your interested look up Pythonista. 

More specific distributions exist Jupyter notebooks is Python specifically packaged for data science to be used interactively on the web; as in you can setup the script to say train a AI and display a graph of the outcome and share it online. It also has GPU access so to speed up any Neural Network training undertaken. Jupyter project page can be found here Project Jupyter | Homeit has both free and commercial versions available.

A similar installation is Anaconda which brazenly declares itself the worlds best data science platform; I haven't tried it to confirm but its popularity speaks for itself. Anaconda is about creating a IDE (a notepad to edit code in) that is optimised for data science and comes pre-packaged with the most important libraries and setup so an IT team can install across a range of devices. Anaconda can be Found here Anaconda | Use Cases 

Jupyter will in fact want you to use Anaconda so when Anaconda says it has 25 million users worldwide there might be some cross over. Suffice to say Python comes with great support for data science. It really is the language of choice for data analytics and data science. So if your business has any aspirations in machine learning or artificial intelligence well you should really know this.

There are other entirely online Python interpreters that allow you to run your code in the cloud.

Between the multiple way's to install Python whether online, on a virtual machine or just newly compiled straight from source you should be able to setup a test area or sandbox for your developer's team that can be tailored to multiple use cases. 

So looking to go into the libraries in Python and to show you could setup a whole business stack in Python lets look at some of the libraries. Libraries are sets of functions and classes that can be added to python that extend it's usability sometimes they are written in Python often they are compiled C which increases the codes speed. There are estimated to be 137,000 available libraries for Python that extend or sometimes radically change the use of the language.

Databases

It is hard to imagine calling anything Enterprise without a database. You could save everything in a set of CSVs and then just access them on demand but you'd quickly get confused by the different files and any function you could write to do left and right joins as well as manage the "relational" in relational database wouldn't be as efficient as the mathematically optimised quick sorts of a proper SQL database.

The following code will create a database called alogiccalledjoes in the same location as other python files on your computer. The variable log is the returned object from the function that gives a connection to the created database. The same code if the database already exist would only create a connection to the existing data. You can see from this Python makes database easy.

 

import sqlite3

log = sqlite3.connect('alogiccalledjoes.db')

c = log.cursor()

 

3 lines of code very easy now we can start adding tables and then adding data into these tables. The great thing about having a connection is afterwards you just run the execute command like the code below and it works the same as any other SQL database using a terminal command line.

 

with log:
log.execute("""
CREATE TABLE USER (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT,
age INTEGER
);
""")

 

The SQL can of course be manipulated like any string to integrate Python variables can be passed into the SQL inserts which of course makes it able to work effectively as a backend database for a website. The developer needs a little bit of knowledge of both Python and SQL to do this but Python has multiple different libraries that tailor it to connect with different database systems.

 

Websites

 

I am not a web developer If I was I might have called this blog something different despite this I am in awe of Python's and especially the library Django capabilities for web design the "batteries included" philosophy of Python makes its way into Django so admin, development, and API all can be ran in one framework. For more information on Django please see here The web framework for perfectionists with deadlines | Django (djangoproject.com).

The list of Python frameworks for website building is quite expansive. Django, Grok, WebPy, TurboGears, WebApp2, Pyramid, and Flask. These frameworks handle the work of listening on a port and replying to another computers get request and sending them the HTML file that gets displayed on their screen as a website. 

If you want a Django developer they still need to know something about the HTTML and CSS that manages web pages. This is because Django is a web development framework it's strength is in helping the developer develop quicker by automating various tasks and standardising certain operations involved in web development, 

You still need a server why not also have a free one you can see from the Heroku (other providers are available) Pricing | Heroku. You may have to pay some more to extend it further but in principle you can build a website in Python. In fact Django powers websites you use all the time like Instagram and Facebook. 

 

“Django powers many of the Web’s most-used sites, like Instagram and Pinterest, even Facebook uses Django for its many behind-the-scenes utilities. Django came from publishing, so it’s no surprise that sites like The Washington Post and Smithsonian Magazine use Django.” — Amit Ashwini, VP of Marketing @ Zibtek

 

Django specialises in speed of making changes and API (Advanced Programmatic Interfaces). These advanced programmatic interfaces allow a user to request data to the database while Django manages the server. An API takes a request from another Programme (usually in Python) and if it puts in the right security credentials and do everything right it sends data. This allows users or even two different companies backend databases to "talk" to each other asynchronously.

A good example of a API is this that will send stock data directly to Python Free Stock APIs in JSON & Excel | Alpha Vantage.

Given we have seen that Python can create, manage and run a database you can bring the methods you share data with customers and suppliers into the modern era with a API. 

 

Emails

 

Well surely Python cannot replace emails and while I do not recommend you try to rebuild Outlook in Python. Gmail and other providers create APIs that allow Python to create a email add attachments and then send it through the email address you connect to.

You'd think next i would say but you can't build a whole server and unfortunately they put that in the standard installation. Plus the sockets library if you wanted to build a whole bespoke web application.

If your tempted by Django and building APIs or email servers then look up courses on data camp Django Tutorial: Python Web Development - DataCamp. I have chosen to focus on data science but i am envious of web developers and will need to upskill eventually.

 

Data Analytics

Data cleaning can be managed by use of the Pandas library. Pandas is a C++ compiled programme that runs inside Python to quickly filter and clean data. 

Once cleaned data can be shown as graphs in visualisation packages like matplotlib and seaborne. You can see from seaborne gallery that the graph's it produce look like minimalist works of art but are actually data analysis. Found here Example gallery — seaborn 0.11.2 documentation (pydata.org).

So you see at a push you can create your graphs in Python send them via a Python server and display them as a dashboard on your Django website.

That being said professional enterprise dashboarding solutions exist in Tableau that directly use Python as their syntax and even Microsoft's Power Bi has the inbuilt functionality to run Python scripts and display visualisations from its libraries. 

Kaggle a free website even provides competitions, free courses, and forums for data analytics, machine learning and much more. You can find it here Kaggle: Your Home for Data Science.

 

Machine Learning

 

Python is often considered the preeminent language for AI and machine learning. Libraries written for Python include fastai, Pytorch, sikritlearn, tensorflow, and keras. These libraries are again often C backed for speed and the majority have capabilities for GPU acceleration. 

Machine learning is a varied subject I won't be covering it here but suffice to say most artificial intelligence can be instanced within a few lines of code within Python. The difficulty where machine learning becomes problematic is ensuring the model is easily explainable for non specialists and identifying stakeholders and making sure they are not adversely affected adversely by it's decisions.

That being said if your reading this and interested in AI download Python learn some courses in Kaggle and start a project. Everyone started somewhere. Kaggle has some great courses on deep learning.

And if you save money on Enterprise technology maybe reinvest it in hiring a data scientists on a consultancy basis to build bespoke AI for your business. 

What's more it is easy for businesses to get started the aforementioned Jupyter notebooks and anaconda make the coding environment for a data scientist to be fairly standardised and if you've got someone knowledgeable in data science the tools are only a installation away.

 

Automation

 

You might take comfort in thinking it can't take control of your web browser and automate clicks, web browsing and web scraping. These capabilities when combined is commonly referred to as RPA or Robotic Process Automation. A great library that allows for this is selenium a link to a tutorial is found here Selenium WebDriver with Python Tutorial - javatpoint.

Selenium allows you to write code that connects to your web browser allowing the automation of many tasks. As you can imagine most work is now done online. It is easy to imagine the power of building bots that can automate many of the simple tasks that a business has in a agile manner. 

Other Python libraries exist for web scrapping i.e. going online and downloading a websites content to the =n extract data or analyse it by AI. AI like this can be used to check online posts for sentiment analysis.

You might think Microsoft wouldn't work with Python; Python being a open source software and Microsoft being a provider of enterprise level technologies.

Python system for interacting with word documents Open Source Python API for Word Processing - Create & Edit Word DOCX (fileformat.com)

I found 19 different libraries for working with Excel so feel free to replace VBA with Python. Here is a website that ranks and scores these 19 excel add ins; Python for Excel - Best open-source Python libraries for working with Excel (excelpython.org). 

And of course you can automate power point from within Python. Link here python-pptx — python-pptx 0.6.19 documentation

So in short you can automate the vast majority of things you do now in Python.

So with a bit of effort if you have standing reports and document's that follow a highly set formula why not automate them with Python? At this point if you've been keeping you already have a API to get all that data and information to update those reports. 

 

Criticism's of Python

 

Use of a large number of libraries even in the same language and the creation of a large code base in likely to accrue a large amount of technical debt and therefore reliance on key programmers to understand the architecture. Failure to keep up with the documentation of changes will result in problems when personnel leave.

Though I would also offer the counter argument this is no less disruptive than the periodic IT transformation when the "enterprise" software you bought is no longer supported or you need to upgrade to it's sequel. As a piece of software Python has been supported from the 1980s, if we changed our understanding of technical debt and our culture around more businesses owning their own code bases we may in fact see "Enterprise" technologies as the risk.

Companies can also manage down technical debt as a risk products such as Github used by professional developers helps manage code bases by tracking releases and version control. Therefore there is clearly a host of risks which risk averse companies may wish to avoid; but if your reading this you must at least be open to the idea of using Python and I think you should. In reality my own view the argument around risk comes down to unfortunately Python won't write itself.

We may say that the smaller number of Python developers are the risk. A python developers average salary according to indeed is £62k Python Developer Salary in United Kingdom (indeed.com).  Though the pay scale for a Oracle database consultant according to Glassdoors is £61k  Salary: Oracle Consultant | Glassdoor. Clearly your not going to avoid those costs if you went wholly enterprise. 

You might say you as a Business culture don't know how to use Python, well if your having to hire consultants for the Visual GUI new Enterprise tool then it can't be said you understood that tool implicitly either.

Though these Python programmers are often non typical of other roles that exist. They could be difficult to recruit as while there are degrees in Computer science many Python coders will have been self taught and utilised online classes to get documentation of their skill. Making it difficult to identify the pros from those who wrote their "hello world" a few minutes ago.

Though companies that do use coders (I'm not talking just Python here) often create hackathons and other non traditional recruitment methods  that strengthen coding skills and allow networking with talent in the community. There does appear to be a link with digital success and corporate culture in multiple investigation's I have found and I will back that up in the conclusion.

Businesses do have real risks in developing their own tools, Django as a framework is designed to limit risks of hacking by making web development a cookie cutter approach repeatable process. That being said many businesses just will not want to touch anything to do with code due to perceive risk around GPRD and loss of personal data. And while that can be solved by when outsourcing making sure to research best new technologies and ensure contractors hold those skills many businesses won't do that preferring to stick to last decades technologies.

What is worth Data Analytics and Data Science not necessarily linked to a risk of hacking will not develop in such companies as also being code the business may not investigate and invest in good technologies linking them by association.

There is good solid technical reasons why you might choose to develop your backend yourself in Python. Though a concern will be for businesses and their cultural views of risk affecting there judgment. Given many of the most up to date AI tools and libraries are currently in Python and improvements to them have been continuous it appears it could be said businesses culture and view of risk may cause them to choose to play it safe and sticking to current technology may be at risk of delay adopting game changing capabilities. 

To show how advanced on the technical Python could also help you gene hack your body...You read that right... and that shows the charm of Python there is always another Library to add in. As soon as you think it's too much effort a new library will tempt you back in.

 

Gene Hacking

 

But surely Python cannot help me with creating a force of genetic super soldiers or I don't know vaccines. Well look at Biopython; Python Tools for Computational Molecular Biology link here Biopython · Biopython

Suffice to say Python is very diverse and useful language. I could go and look up libraries on robotics or a myriad of other use cases.

 

Conclusion

 

So first point for this conclusion; yes I recommend Python...

If you scoured Linkedin adds (at least in the U.K. at time of writing) many would reference excel, maybe SQL some might list leadership or entrepreneurship  for Data Analyst roles (what does entrepreneurship look like in IT, do i get to haggle for a pay raise?). And some will just list a whole IT department worth of languages, service desk tools, assorted conceptual frameworks and libraries that they expect wrote memorisation (some of them may have read this very article to add to said list).

Ironically many IT jobs that list a whole IT department level of capability in job spec are the worst paying and clearly come from managers who copy pasted there job spec. And this is the final conceit of this conclusion when investigating why a company chooses to use Python or Enterprise the evidence is performance or rightness of the technology has nothing to do with the likely adoption of that technology within a business.

Triplebyte a company that specialises in testing and hiring software engineers analysed 6 months worth of data from technical interviews and discussed with CTOs and founders across top 25 companies the results are available here Who Y Combinator companies want (triplebyte.com) . To me the most poignant conclusion from the site was the following.

 

"The types of programmers that each company looks for often have little to do with what the company needs or does. Rather, they reflect company culture and the backgrounds of the founders. It’s nearly impossible to judge these preferences from the outside. At most companies, however, non-technical recruiters reject 50% of applicants by pattern matching against these preferences. This is a huge frustration for everyone involved."

 

Consider companies like Google, Microsoft, Amazon, Facebook, Apple, Deloitte, or Tesla. Actually if you look at their products they have nothing in common. Admittedly there all American but I'm British I'm not sure I can copy that. Though what they have all in common is abilities to code and many have used Python. Clearly a small number of businesses are doing things the rest of us are not. Maybe it's their culture?

Triplebytes investigation should be stunning to any business strategist or CEO reading this. You don't get the programmers that match your technical requirements of the project because HR are too busy rejecting them based on intangibles completely unrelated to the project. 

And this bring us to the stunning and counterintuitive proposition,  to become a tech company that saves money on "enterprise software" use cutting edge tools and compete on a more global stage. The surprising answer is CEO's shouldn't talk to IT but do some self reflection and discuss the problem with HR.

And on that we return to Peter Drucker quote; in light of Triplebyte's research we might reverse it and suggest in the long term it isn't even good for the business unless it manages to also be good for society. 

Add comment

Comments

There are no comments yet.

Create Your Own Website With Webador