Same script, but without external packages:

#!/usr/bin/env python3  
import urllib.request
from dataclasses import dataclass
from http.client import HTTPResponse
import json  
class DocTags:  
    id: str  
    tags: [str]  
def parse_line(values: [str]) -> [DocTags]:  
    assert len(values) == 2  
    doc_id: str = values[0]  
    tags_str: str = values[1]  
    tags = list(map(str.strip, tags_str.split(",")))  
    return DocTags(doc_id, tags)  
def read_file(filename: str) -> [DocTags]:  
    result = []  
    with open(filename, 'r') as file:  
        while True:  
            line = file.readline()  
            if not line:  
            fields = line.split("\t")  
    return result  
def json_request(method: str, url: str, json_obj) -> tuple[HTTPResponse, str]:  
    json_str = json.dumps(json_obj)  
    body = bytearray(json_str, 'utf8')  
    req = urllib.request.Request(  
        url, data=body, method=method,  
        headers={'Content-Type': 'application/json'}  
    response = urllib.request.urlopen(req)  
    response_body = str(, 'utf8')  
    return response, response_body  
def main():  
    docs = read_file("example.tsv")  
    for doc in docs:  
        with open(f"out/{}.txt", 'w') as file:  
            resp, body = json_request(  
            file.write(f"status_code={resp.status} json={body}\n")  
if __name__ == '__main__':  

In principle, it’s fine. Of course, technological code has appeared, but not too much.