Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ahmed TAHRI Newsgroups: comp.lang.python.announce Subject: [ANN] kiss-headers, a dedicated package for reading and exploiting headers from HTTP or IMAP. With auto-completion support. Date: Wed, 18 Mar 2020 10:41:45 +0100 Lines: 28 Approved: python-announce-list@python.org Message-ID: <158452973023.25192.python-announce-list@python.org> Reply-To: python-list@python.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de yv+9DeL+s0udUBaI89689gsZY81mmlCqko6KyPvFFMBQ== X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'url-ip:140.82.118.4/32': 0.02; 'url-ip:140.82.118/24': 0.02; 'url-ip:140.82/16': 0.02; 'are.': 0.07; 'expose': 0.09; 'received:mail-oi1-x233.google.com': 0.09; 'values.': 0.09; 'url-ip:140/8': 0.10; 'url:github': 0.13; 'community.': 0.14; 'header': 0.14; 'attributes,': 0.16; 'chunk': 0.16; 'dictionary': 0.16; 'extracting': 0.16; 'headers.': 0.16; 'str.': 0.16; 'subject:ANN': 0.16; 'subject:auto': 0.16; 'subject:reading': 0.16; 'subject:] ': 0.22; 'object': 0.26; 'simple,': 0.26; 'community': 0.26; 'code': 0.26; 'idea': 0.27; 'subject:for': 0.28; "i'm": 0.30; 'working': 0.30; 'message- id:@mail.gmail.com': 0.32; 'received:google.com': 0.34; '8bit%:14': 0.34; 'subject:[': 0.35; 'requests': 0.36; 'trying': 0.38; 'should': 0.38; '8bit%:24': 0.39; 'fact': 0.39; 'headers': 0.40; 'http': 0.40; 'to:addr:python-announce-list': 0.40; 'worry': 0.40; 'more': 0.61; 'came': 0.61; 'license': 0.61; 'decided': 0.62; 'skip:\xc2 10': 0.63; 'your': 0.64; 'hope': 0.64; 'well': 0.65; 'access': 0.67; 'skip:h 60': 0.68; 'sweet': 0.68; 'subject:, ': 0.69; 'based': 0.70; 'capable': 0.70; 'them,': 0.70; 'deal': 0.72; 'seen': 0.72; 'url-ip:lookup error': 0.74; 'accessing': 0.76; 'subject:. ': 0.82; 'stupid,': 0.84; 'thrilled': 0.84; '*no': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudnursery.dev; s=google; h=mime-version:from:date:message-id:subject:to; bh=ox5LYivI1nwmvGF3xLCPGIXth+MrFDJFx8pEGgPjNgM=; b=O1V99Gv3M62Udrm+ErfAdHUGEVcKOHI2HjPII/onFS09TFiCY9kuLDiGc9ogIiQYJF DK8Bwo09E3AkOej1c06tBmtqgvIcYt3bX6OXd2mZyQ9qBKuT62FczQu9thyM6j0SJJSx AYE/MtkM3YEug5XNqQAiDAomaEVdfZeeScZXmlQ9VWBFzjwKsu44172zpdQHUYJgfNgn Ua/hN6oX2HIRdz4I7XDpzWrA5Q7hw5/XouW35M/iUdBFJipTa0OT6MnFmHp2y9qmlQrq fOYFZjI0sxgWs/GqpgmbtPV+MfJQEMKO6TEeNneZzkWOxBEdOc1JFXao0IYOi5ZT+MXQ UPCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ox5LYivI1nwmvGF3xLCPGIXth+MrFDJFx8pEGgPjNgM=; b=KCU0TgMCdjVL7rLzuLgVAE9sIROkh23pS3ndy6V0TgC8YrDNMj5AN3383llCXps3KU VyYKpzpYNFfNlWbqRjLBx+CFmQ5gjsd53PeSBJxtQrztbiL1OPNSuMMARMSpgtROX40g 62s+kZTPpuO5W/OCm+2TZnMLLnLf3xl6g68gnlNYxGMChf3lv1/hBnqXfWTGutVZvLpl FHg8gyQBS8V/Il1iFneEBkcSLCIAHWAtTEG47qUE3r2hHZCXE3dfxO4+GdWF2td+6ymE Vs+9giHKpGuKOYDeg9EOJ1KDOYAE92BcVMwGJNTlJrOJkVG9hsR8kaMOf+4zxa9lCGuZ i7vg== X-Gm-Message-State: ANhLgQ3i/XATY69giT7xZn2FiDmh9ci25tjZSb4L1XZapCuk1rbFA7HN L3yXOjregdL58EFv7g+T+Y+djbzFkjsLhRRVbj3wkQD4B3E= X-Google-Smtp-Source: ADFU+vtPsU9VwCUphmHomgiB0ns1E+sqDSCFTFCZ5ZZ9G7Q93kcdrNrsFPrauTshZMaykV889LjcE0/Rb2SIWfHvZRI= X-Received: by 2002:aca:4fc7:: with SMTP id d190mr2473617oib.100.1584524515918; Wed, 18 Mar 2020 02:41:55 -0700 (PDT) X-MailFrom: ahmed.tahri@cloudnursery.dev X-Mailman-Rule-Hits: emergency X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved Message-ID-Hash: PCZJYTHK6HQUVZMIGSLY3KUECJYWBUNQ X-Message-ID-Hash: PCZJYTHK6HQUVZMIGSLY3KUECJYWBUNQ X-Mailman-Approved-At: Wed, 18 Mar 2020 07:08:41 -0400 X-Content-Filtered-By: Mailman/MimeDel 3.3.1 X-Mailman-Version: 3.3.1 Precedence: list List-Id: Announcement-only list for the Python programming language Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Xref: csiph.com comp.lang.python.announce:3341 I'm thrilled to share with the community =C2=B4kiss-headers=C2=B4. "Keep It= Simple, Stupid, Headers". This idea came from the fact that I have seen so much chunk of code trying to deal with headers, often I saw this : charset =3D headers['Content-Type'].split(';')[-1].split('=3D')[-1].replace= ('"', '') *No more of that !* =F0=9F=A4=AE No matter your religion, IMAP4 or HTTP, you should not worry about accessing easily header and associated attributes, adjectives or values. Even =C2=B4psf/requests =CC=81 represent headers with a dictionary and that= is not representative of what headers are. They are not 1 to 1. And accessing 'Content_type' should work as well as 'Content-Type'. This package is capable of extracting original headers, unmodified and exploitable from a Response object of requests or bytes, fp or str. It is working on both HTTP and IMAP headers. So that is why I decided to expose a sweet way to access them, based on the most common needs o f the community. The license is MIT ! Take a glimpse at it : https://github.com/Ousret/kiss-headers Hope you like it !