Skip to main content
14 votes
Accepted

Raspberry PI controllable Christmas Tree

I would suggest to separate the concerns of coloring and animating. Now, in particular theater_chase_rainbow duplicates code from other methods. Instead, have ...
Janne Karila's user avatar
  • 10.7k
8 votes
Accepted

Python/Flask Password Manager

Disclaimer: I haven't done authentication in Flask before. Tl;dr: Don't do authentication yourself, it's VERY hard to do right (and using a global ain't right); also, separate the user's ...
scnerd's user avatar
  • 2,090
6 votes
Accepted

Python function to implement an image-processing pipeline

As Reinderien mentions, you can decrease some of the complexity of your code by inverting your if-statements. While I cannot test this because I do not have your whole code, here is how it could be ...
esote's user avatar
  • 3,800
5 votes

A simple library using Flask and SQLAlchemy

Document with docstrings. Your functions and ORM models are currently not providing any useful documentation regarding their respective function within your program. Don't initialize the database on ...
Richard Neumann's user avatar
5 votes

Python Flask, best way for users to update profile details

At the least, this can be done more efficiently: ...
Reinderien's user avatar
  • 71.1k
5 votes
Accepted

Flask App: ML Project on Predicting Weather

High level advice: helper functions are your friends, use lots of little ones. defer execution This runs at import time: ...
J_H's user avatar
  • 42.1k
4 votes
Accepted

Blog with Python/Flask

Date formatting self.date_created = f"{now.month}/{now.day}/{now.year} {now.hour}:{now.minute}:{now.second} {end}" should be ...
Reinderien's user avatar
  • 71.1k
4 votes
Accepted

Authenticating an internal API with Flask

Just because you don't have many people using this API now, this does not mean that this will always be the case. In addition, you might want to discriminate between the users of the API for various ...
Graipher's user avatar
  • 41.7k
4 votes
Accepted

Fetching Python news headlines for Alexa

You probably want to move the session to a global variable(or simply use requests.get) else at function level it is not helping in re-using any connections right ...
Ashwini Chaudhary's user avatar
4 votes

on using the strategy pattern to switch between database layers

Typically you'd have two classes that implement the four methods create, read, update and delete, one for Mongo and one for ...
nullTerminator's user avatar
4 votes
Accepted

on using the strategy pattern to switch between database layers

The short answer is: You don't need the strategy pattern here. just do as nullTermiator said in his answer. To understand why strategy does not fit here, first we need to understand the problem ...
Mostafa Kashwaa's user avatar
4 votes
Accepted

URL shortener using Flask

I do have a few comments: Handling Non-Unique Digests It's good that you recognize that digests such as MD5 are not guaranteed to be unique. But, although you have ...
Booboo's user avatar
  • 3,536
4 votes

Flask web normalizer CSV app

Disclaimer: I haven't run your code, so this is a static analysis exercise based on what I have noticed while perusing it. Routes This method only accepts GET requests: ...
Kate's user avatar
  • 8,313
3 votes
Accepted

Getting prices of crypto coins

Well, I shall start from the top. According to the style guide, PEP 8 imports should be in the following order: standard library imports related third party imports local application/library ...
Walid Mujahid وليد مجاهد's user avatar
3 votes
Accepted

Flask Framework - user sign in

There are a few things bothering me in one version or an other: the error=error or None is unnecessary as error is either ...
301_Moved_Permanently's user avatar
3 votes
Accepted

A storage bin thingy for Repl.it projects

Few optimization tips verify_password function avoid bare except: clause - at least use ...
RomanPerekhrest's user avatar
3 votes

Weather Forecast Web Application

URL URL components should generally appear from "broadest to narrowest" left-to-right. I'm not totally convinced that this is currently the case - the weather site is probably "broader&...
Reinderien's user avatar
  • 71.1k
3 votes
Accepted

Python Rubiks cube solver - general code comments

You should put your Configure Memcache section into a function to clean up the global namespace, even if you unconditionally call it from the global namespace. ...
Reinderien's user avatar
  • 71.1k
3 votes
Accepted

Read and display JSON results from Google Books API

Split search() up into two functions, each accepting only one method, and dispose of your if. There's a little bit of religion ...
Reinderien's user avatar
  • 71.1k
2 votes
Accepted

PyFladesk Migration

I’m not too found of putting it all into a single method as: it seems to have too much responsibilities; building some objects (QThread, ...
301_Moved_Permanently's user avatar
2 votes
Accepted

Flask web application, with handling for user login status

Despite html code indeed looks nice, is there where you want to point out your efforts Jinja supplies conditional blocks (like in python) where you can define which buttons you want to appear on ...
A. Romeu's user avatar
  • 1,123
2 votes
Accepted

A simple library using Flask and SQLAlchemy

Your database management is kind of a mess: SQLAlchemy recommend to keep your sessions scope the same than your requests scope; Having a single, global, ...
301_Moved_Permanently's user avatar
2 votes

A website status monitor in Python/Flask

This looks like a very good status page. Well done ! Review from settings import refresh_interval, filename, site_down I recommend that you use set of config ...
JaDogg's user avatar
  • 4,561
2 votes

Flask application for buying stocks

Unclosed Connection Your dbexe method has a bug. If the elif statement is executed, tupdata ...
Ben A's user avatar
  • 10.8k
2 votes
Accepted

Jinja2 block that is unreadable

In the end I refactored like this: ...
Alex Harvey's user avatar
2 votes
Accepted

9X9 Tic Tac Toe variant with frontend in react and backend in python flask_socketio

I'm not fantastic with Typescript; so let's take a look at your Python: Credentials app.config['SECRET_KEY'] = 'secret!' This shouldn't be baked into your code. ...
Reinderien's user avatar
  • 71.1k
2 votes
Accepted

How to make the filtering queries more efficient using flask sqlalchemy?

I think this should work: ...
pjz's user avatar
  • 2,406
2 votes
Accepted

Track the existence of process

There is nothing I can test here, so I will only make a couple superficial remarks. You do not offer a lot of insight into your application. If you say you have a problem with overlapping queries, ...
Kate's user avatar
  • 8,313
2 votes

Air Quality/Environment Monitoring Web App using Plotly Dash

I have no experience with any of these libraries, so I can only comment on aspects of the language itself. ...
Carcigenicate's user avatar
2 votes
Accepted

Flask app to return close prices & average

Relays Your current design: fetches data from alphavantage once, on startup offers it to anyone who hits any of your interfaces on port 5000 (which, by the way, is already used by a large number of ...
Reinderien's user avatar
  • 71.1k

Only top scored, non community-wiki answers of a minimum length are eligible