Async python with asyncio

You have two options for concurrent python Traditionally, we used threads with python for concurrency, but the release of the asyncio library (version 3.4) and the release of async/await syntax (version 3.5) created support for native coroutines that are familiar to users of the many languages that support it. (history of asyncio) asyncio (docs) The…

Django and pgvector for semantic search

Goal: Semantic Search Setup pgvector You have a model with a field you want to make semantically searchable. Installation comes from: https://github.com/pgvector/pgvector-python Step: install pgvector on your machine Step: create a migration to activate Step: add a VectorField to your model Step: make migrations and migrate Setup sentence transformers for embeddings We will use the…

How to install Python 3 on Mac using homebrew

tldr; install brew; brew install python Homebrew is a great installer for Mac and its main job is to make it easier to install packages. Step 1: Download Homebrew here “brew” hosts its package information here as “formulae“. Step 2: Use brew to install the latest version of Python $ brew install python –verbose Now you…

Levels of installing python

This is an opinionated route towards python management. Every computer may have its own set up. Level 0: “I just want to play with python” Method 1: Use and online REPL like this: https://repl.it/languages/python Level 1: “I want python on my computer” Download brew, use brew to download the latest version of python and go crazy.…