Onebite.dev

Developer tips & trick, one bite at a time

Dev blog around python


Solving Error: pg_config executable not found psycopg2 install On my mac machine, I tried to install a new python library with psycopg2 in it, I got pg_config error, here's how I solve this error
How to add multiple types in pydantic To allow pydantic to accept multiple values we can use Union
How to make bcrypt checkpw function work If you're using bcrypt in python, and try to use checkpw but keep failing, probably you save the hashed password in database wrong. Here's how I solve it.
Solve alembic multiple head revisions are present Just like git, When you have multiple branches on your migrations of sqlalchemy's alembic. It will tell you that you have two different versions that need to be solved.
How to convert sqlalchemy object to json in FastAPI Have you struggled on How to convert sqlalchemy object to json in FastAPI? Do you know that fastapi has jsonable_encoder to do exactly this job?
Solve error Alembic Can't locate revision identified by id_number If you're using Alembic as your migration tool for sqlalchemy project on your python program, you might encountered this problem before -Alembic Can't locate revision identified by id_number- here's how to solve it.
How to bulk update in sqlalchemy python? Update multiple columns one by one is daunting. Learn how to do a bulk update on Sqlalchemy in python programing language to update multiple items at once.
How to count most used words in database with python How to count most used words in a sentence or article with python programming language