Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #3341

[ANN] kiss-headers, a dedicated package for reading and exploiting headers from HTTP or IMAP. With auto-completion support.

From Ahmed TAHRI <ahmed.tahri@cloudnursery.dev>
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 2020-03-18 10:41 +0100
Message-ID <158452973023.25192.python-announce-list@python.org> (permalink)

Show all headers | View raw


I'm thrilled to share with the community ´kiss-headers´. "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 = headers['Content-Type'].split(';')[-1].split('=')[-1].replace('"', '')
*No more of that !* 🤮


No matter your religion, IMAP4 or HTTP, you should not worry about
accessing easily header and associated attributes, adjectives or values.
Even ´psf/requests ́ 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 !

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

[ANN] kiss-headers, a dedicated package for reading and exploiting headers from HTTP or IMAP. With auto-completion support. Ahmed TAHRI <ahmed.tahri@cloudnursery.dev> - 2020-03-18 10:41 +0100

csiph-web