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
How to go from "hello world" to real applications?
This one is for you
#100daysOfCode #100DaysOfMLCode #Python
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
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
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.
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.
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
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
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: https://testdriven.io/blog/modern-tdd/
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: https://testdriven.io/blog/modern-tdd/
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: https://testdriven.io/blog/modern-tdd/
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: https://testdriven.io/blog/modern-tdd/
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
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
PostgreSQL
Start using PostgreSQL instead of SQLite
You should only edit ExpenseRepository
Create script to copy all existing data from SQLite to Postgres
Start using PostgreSQL instead of SQLite
You should only edit ExpenseRepository
Create script to copy all existing data from SQLite to Postgres
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
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
Dockerize and deploy
Dockerize your Flask application
Deploy to Heroku (don't use DB in docker, use it on Heroku) https://testdriven.io/blog/dockerizing-flask-with-postgres-gunicorn-and-nginx/
Dockerize your Flask application
Deploy to Heroku (don't use DB in docker, use it on Heroku) https://testdriven.io/blog/dockerizing-flask-with-postgres-gunicorn-and-nginx/
Start using your application for real
Start tracking your expenses
Even the most little ones
Don't forget to add them daily
Start tracking your expenses
Even the most little ones
Don't forget to add them daily
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
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
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
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
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.
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.