- Alexis Métaireau
- Journal
- Code, etc.
- Notes hebdo
- Lectures
- Projets

# Tag « Python »

21 novembre 2023 Python, CRDT, Sync, uMap

# Adding Real-Time Collaboration to uMap, second week

A heads-up on what I've been doing this week on uMap
11 novembre 2023 Python, CRDT, Sync, uMap

# Adding Real-Time Collaboration to uMap, first week

A heads-up on what I've been doing this week on uMap
18 octobre 2023 SQL, SQLAlchemy, Python

# Using DISTINCT in Parent-Child Relationships

How to get parent and most-recent child in a one-to-many relationship
11 octobre 2023 python, conversion

# Convert string to duration

I found myself wanting to convert a string to a duration (int), for some configuration.

Something you can call like this:

    string_to_duration("1d", target="days")
    string_to_duration("1d", target="hours")
    string_to_duration("3m", target="hours")
    string_to_duration("3m", target="minutes")

The code :

    from typing import Literal

    def string_to_duration(value: str, target: Literal["days …

27 septembre 2023 python, llm, bash, sqlite

# llm command-line tips

I’m using llm more and more, and today I had to find back prompts I used in the past. Here is a command I’ve been using, which allows me to filter the results based on what I want. It leverages sql-utils, a cli tool which is able to …

17 août 2023 python, packaging, zsh

# Python packaging with Hatch, pipx and Zsh environment variables

It’s been a while I didn’t packaged something new. I recently remembered an old package of mine that needed some attention : debts. It’s now time to package it, so I discovered hatch

hatch new —init

This does the heavy-lifting for you, actually porting the `setup.py` files …