🤷‍♂️You've learned basics of Python and you don't know what to do next?

How to go from "hello world" to real applications?

🧵 This one is for you👇

#100daysOfCode #100DaysOfMLCode #Python
1️⃣ Build expense tracker CLI app.

Each expense should have following attributes:
* title (string)
* amount (float)
* created_at (date)
* tags (list of strings)

Store expenses in TXT file.

Cover: Add expense, list expenses, get expense, edit expense, delete expense
2️⃣ Add database

Instead to storing/reading in/from TXT file start using SQLite.

Write script to copy all of the existing expenses from TXT file to database.

Don't use ORM at this point.
3️⃣ Start using classes

Represent expense with class Expense having attributes:
* title (string)
* amount (float)
* created_at (date)
* tags (list of strings)

Represent Database with class ExpenseRepository with methods: save, get_by_id, list, delete
4️⃣ Rewrite app to use commands and queries

Each command/query is class with method execute.

At initialization you need to provide all required data for execution.

Commands: AddExpense, EditExpense
Queries: GetById, ListAll

Maybe this post can help:
testdriven.io/blog/modern-td…
5️⃣ Add tests

Add tests for commands and queries

Example:
GIVEN valid data
WHEN execute method is called on AddExpense command
THEN record is created in database with same attributes as provided

The same post may help you:

testdriven.io/blog/modern-td…
6️⃣ Flask

Use Flask to build the web application for your expense tracker

Reuse commands and queries inside views

Use Jinja2 for HTML templating

Add integration tests for endpoints
7️⃣ PostgreSQL

Start using PostgreSQL instead of SQLite

You should only edit ExpenseRepository

Create script to copy all existing data from SQLite to Postgres
8️⃣ Authentication

Add sign up and login to your Flask application

Protect endpoints for expenses to allow only logged in users to use them

Allow user to only see own expenses
9️⃣ Dockerize and deploy

Dockerize your Flask application

Deploy to Heroku (don't use DB in docker, use it on Heroku)

testdriven.io/blog/dockerizi…
1️⃣0️⃣ Start using your application for real

Start tracking your expenses

Even the most little ones

Don't forget to add them daily
1️⃣1️⃣ Data analysis

Use Pandas and Matplotlib to analyze your expenses

Check frequency, check biggest amount, smallest amount, average amount, most frequent amount, most used tags, ...

Draw plots: number of expenses per day, amount spent per day
1️⃣2️⃣ ML

Build model which will predict tags based on title of expense

Use your existing records

Although your data set is small, try to build model as precise as possible
1️⃣3️⃣ Congratulate yourself

Don't forget to write blog post for each of these steps.

Don't forget to share your code for the project in public git repository such as Github, Gitlab, Bitbucket.

Don't forget to tweet about it.

Don't forget to add all the skills to LinkedIn.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Jan Giacomelli

Jan Giacomelli Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @jangiacomelli

23 Nov
Python is a great choice for the main backend programming language in a startup

Here are some reasons why

#100daysOfCode #100daysOfMLCode #Python #Startup

🧵👇
1️⃣ Easy to write & easy to read

It reads and writes almost like the English language. You need a small amount of code to get a job done. You'll probably rewrite it at least 3 times.
2️⃣ 1st class citizen on cloud platforms

You don't want to deal with physical servers in a startup. You just want to run your app. Python has cloud SDK libraries, it runs on serverless platforms, it's used in ML services, a lot of examples in cloud docs are using Python.
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!