Fun coding project!
July 26, 2018 12:09 AM   Subscribe

I've been asked to build a relatively simple and feature-lite inventory management system. I want to do it in Python, and I need a nice GUI also. But I'm a beginner in Python, and I'm not sure how to approach it. Can you tell me what I need to learn to do this?

Hi folks! I have the opportunity to make an inventory management system, and I think it would be super fun, but I have a lot to learn to make it happen. But what should I learn? How would you approach this?

This inventory management system will replace a paper-based process (!) at a boutique manufacturing firm that can't afford a proper solution.
Here's what this system would need to do:
  • Allow people to add to and subtract from the parts inventory database (that doesn't exist yet)
  • Allow people to specify a location in the warehouse for a given part
  • Allow people to enter serial numbers of parts
  • Spit out a printable picklist of the parts needed (and their physical locations) for each product build
  • Generate a purchase request form on demand and route it to the Purchasing people by email
  • Beautiful GUI (this place is super-concerned with aesthetics)
Here's what would be cool:
  • Android phone app
  • Being able to scan a QR code to enter the part number and location
  • Interface with QuickBooks
  • Print out the latest version of the build instructions on demand
  • Easy ways to look up all the data on a given product build, or all builds of that product, or all builds using that part, etc.
Maybe MS Access can meet their basic needs, and that is what they will use if I can't do it fast enough. They want this fast if I can do it fast, but if not, my system will replace Access whenever I can deliver it.

Django? Flask? Tkinker for the GUI? What? How would you do it? You tell me that, and then I will learn those things and build it!
posted by pH Indicating Socks to Computers & Internet (15 answers total) 8 users marked this as a favorite
You see fun coding project, while I see about 3-4 months of work.

First you need a database with a well designed schema.
Are you going to handle concurrency ie can many people interact with the system at once?
How many different people are going to be suing this system?
How many different locations are required?
Serial numbers are unique to each part or unique to each type of part?

It will probably take a few days to design the schema for the database alone.

For the actual management system are you going to have some sort of user management to allow for different levels of access?
Can anyone write to the database?
How secure is the system ie for the android app it essentially must have an outside facing interface. You wouldn't want to be doing security through obscurity.

Good GUIs are hard, pretty GUIs that are also useful are double hard. I would expect the GUI itself to take a few weeks to be useful and another few weeks to get it pretty.

Have you ever used the quickbooks api? Does it even allow for a python integration or would you essentially be using a server interface again?

Starting from scratch as a novice python person I think it will take a year to do this "fun coding project" who are they going to go to once they find some quirks that need ironing out?

How much are they paying you for doing all of this work?
posted by koolkat at 1:39 AM on July 26, 2018 [13 favorites]

I'd go with a Django web app, because I know how Django works. Flask would also be great. Go with a web GUI for your MVP.

It's very easy to build a little CRUD app with Django. I'd spend a bit of time thinking about the data model, because that's the most annoying thing to refactor later. For a database, you can probably get away with sqlite3 initially, but I'd want to run on PostgreSQL for real. Don't use a nosql db - this sort of app lends itself to a relational model.

Once you have a web app working, you can look at building a simple Android app that exposes the REST API that Django creates for the web app, and integrate that with a QR library.

I've been hacking on this sort of thing for a long time, and I would expect a 'Doing a favour for a mate' level of sophistication to take me a week. I'd have the basic app in a few hours, but integrating with a decent test framework, CSS/HTML polish, and building an automated build and deployment pipeline adds a surprising amount of faff. Once you have that in place, it makes life much easier later, but it's a big chunk of overhead initially.

Set your customer's expectations, and get hacking. There's a huge community out here to help!
posted by Combat Wombat at 1:41 AM on July 26, 2018 [2 favorites]

koolkat is entirely correct.

My answer applies to "Build a quick hack for a mate, see if it works." koolkat's answer applies to building a robust system to a professional standard.

I've done heaps of these sort of things, usually starting with "A quick hack to get you going." The worst thing is when it works, and you've created a need for ongoing support and development without setting the expectation of $200 an hour rates.
posted by Combat Wombat at 1:48 AM on July 26, 2018 [1 favorite]

If you are going to do it, I would say first move the paper process to a manual process using one or more online spreadsheets (with steps that perhaps involve copying a master spreadsheet and sorting it via the UI to get the rough picklist, or other manual processing of a copy of the data) and get the actual computerized-but-manual workflow sorted out. In the mean time you can work on automating little bits of that process: for example a simple tool to take a pasted-in set of spreadsheet rows representing the picklist (an array in any programming language) and generate the purchase request and email it.

More broadly, you would want to break it down into a series of discrete deliverables that will still have value if you're interrupted at any point or find that you have greatly underestimated how long it will take you to learn and go through enough design-and-implement cycles for any given aspect of the system and consequently run out of time. Trying to do it all at once the first time you've ever done something like this, the first time this business process has ever been automated in this organization, is a recipe for a death march followed by a catastrophe.

Honestly it's probably in your own best interest to let whoever has volunteered to build an MS Access application do it. (Especially if that person has the clout to just force the users to go along with whatever they create, while you would have to live up to guesses you make about how beautiful the GUI is going to be and what your system will do.)
posted by XMLicious at 1:55 AM on July 26, 2018 [7 favorites]

If I were you I'd leave these three out:

Android phone app
Being able to scan a QR code to enter the part number and location
Interface with QuickBooks

Each one requires you to learn an entire new subsystem, when you don't really know how you're going to handle the main issues yet. Leave them out and focus setting up a good architecture for the main functionality - if you do it right, the extra stuff will be easy to add on later.
posted by each day we work at 2:48 AM on July 26, 2018

Best answer: How about building on or implementing an open source solution instead of coding something from scratch.

One that I have read about, but not implemented commercially is Odoo. They have a Community Edition which is open source and based on Python.

I'd also echo Combat Wombat's advice above. Everyone's ideas are always for something quick and cheap, but once that is built, there should be a path to a more complete product that doesn't require throwing everything out and starting again.
posted by Gomez_in_the_South at 3:02 AM on July 26, 2018

I've actually maintained a university's chemical inventory managment system that had both MS Access and a web application interfaces. I'd consider koolkat's and XMLicious' answers carefully because this project can take a lot of effort for one person beginning in Python.

I worked on the DB and data access code so I'll emphasize spending time to learn about data modeling, and particularly the relational model. Consider how the schema might need to change over time to meet new business requirements. If you anticipate the inventory data may contribute to business intelligence needs, start planning to capture historical data. If they go with an MS Access database, you're going to have to learn how to migrate that data to whatever schema you come up with and maintain data integrity. You'll need to figure out how to conduct data migrations for any complex schema changes. Learn SQL and DDL well so you can deal with the limits of any ORM you may use with a framework like Django or Flask.

Be wary of feature requests before core functionality is finished. XMLicious' advice on discrete deliverables is spot on.
posted by Mister Cheese at 3:48 AM on July 26, 2018 [2 favorites]

The Python route is definitely doable (Flask + Bootstrap for a good enough looking GUI) -- I'm wondering if you could also try doing this in a more lightweight way that might take you less time.

I agree with XMLicious -- try automating this with an online spreadsheet first, and discretize the deliverables as much as you can (i.e., work on one of your bullet points at a time). I would recommend checking out Airtable, a mix of online spreadsheet/database. This is their example Inventory Tracking sheet -- which probably took less than an hour to setup (which is way less than what you'd need for a custom Python web app with GUI, user management, etc.).
posted by vert canard at 3:55 AM on July 26, 2018 [3 favorites]

Another important detail: does the company have IT staff who are going to handle backing up the database and files regularly, or for example installing an Android app on phones or tablets and troubleshooting it, or is that all going to be you too?

How many different people are going to be suing this system?

Probably just a Freudian slip there on koolkat's part but if you are not an employee of this company who is building this as part of your normal duties (and maybe even then!) you'll want to carefully consider, and ensure there's a clear understanding, of your responsibilities as the creator of the system you provide to them: things like data security, disaster recovery, fixing bugs, or what it will cost them if some circumstance means they have to stop using the system once they've grown dependent on it—even simply what will happen if the internet goes down. (The latter eventuality, if they have to stop using your system temporarily or permanently, is another good reason to have documented manual workflows to fall back on and maybe even keep copies of the current paper forms and records on a shelf somewhere.)
posted by XMLicious at 4:49 AM on July 26, 2018 [1 favorite]

I can’t tell from your question whether you are just new to Python or also new to programming. How long it will take you will probably depend on that to some extent.
posted by eirias at 6:03 AM on July 26, 2018

I second using Django. The Django Girls tutorial will get you up and running with python + django, and probably give you an idea of how time consuming the whole project will be.

If you have it all as a webpage, do you really need a dedicated android app? All it would be doing is encapsulating your webpage anyway.
posted by tofu_crouton at 6:10 AM on July 26, 2018

Response by poster: Yeah, yeah -- you're right, you guys. This was indeed a "Build a quick hack for a mate, see if it works" situation, but I don't really want my good time to come at the cost of total chaos at his job if they implement my janky-ass system and something goes wrong.

Odoo is perfect. Free for limited functionality that will satisfy his immediate needs, and expandable if they are willing to unass the money for barcode scanning, an Android app, etc. Thanks, all! Even though I'm not going to make the thing myself now, you've each given me insight into how these kinds of things work -- which is interesting and potentially useful to me, as I start coding bootcamp on Monday!
posted by pH Indicating Socks at 6:39 AM on July 26, 2018 [2 favorites]

I think you've made a good decision. koolkat is 1000x correct in their assessment. I am a professional web dev working on decades of experience and and trust me, these types of projects can get so blown out of the water with feature creep its amusing after a while. It's already started with your android app and QR code stuff, and then there will be reporting requests, and and and... And if this place is concerned about aesthetics as you mention they will probably need a designer, then you need someone who can implement their designs, which is a whole other thing. I'm going to guess they would not be cool with a simple bootstrap design. This is absolutely something any self respecting business should be paying for if they plan to use it to help them run their business, and if they're not willing to, you need to run, not walk away.
posted by cgg at 9:12 AM on July 26, 2018

Nthing your smart decision. There are so many hidden gotcha corner cases on that list.

You might consider browsing github for existing applications. Something simpler may help the process, but also beware partially finished code, there is a lot more in php than python.
posted by sammyo at 12:43 PM on July 26, 2018

I'd take the time to be sure you know their requirements before starting. Once you're sure of what they want (and it almost certainly will change over time), come up with a plan to deliver a minimally useful application, and build from there. This is one of the tenets of Agile programming. Once you deliver the absolute minimum (perhaps just the database and a way of entering and viewing data), you can build up the next-most minimum requirement (account level privileges, perhaps, or entering/printing pick lists), then the next, etc.

By adding features and value incrementally, you can more easily handle the inevitable changes in requirements, and give them an ever-increasingly valuable application until the day you and they decide it's done.

Plan for security from the ground up, so J. Random Warehouseman can't mess up the #4 widget count but the materials buyer can enter the raw materials received as needed. And don't neglect backup, (not that you have to write that yourself).
posted by lhauser at 9:44 PM on July 26, 2018

« Older What are some unusual text-based and text-adjacent...   |   Who are some artists that peaked with their first... Newer »
This thread is closed to new comments.