Skip to main content

Constants for IANA message headers (http, mime, mail, etc)

Project description

Reason this exists

Wouldn't it be better to retrieve Http header information using a Http header constants, like this request_headers.get(http.REFERER). Constants such as http.REFERER for the string Referer reduces typos, and having to remember the exact spelling for Http headers.

This library does the following:

  1. Refers to the list of headers registered with IANA: https://www.iana.org/assignments/message-headers/message-headers.xhtml . The definitions are available for download, as CSV files. These files are present in the references folder.
  2. Generates the headers, under the headers package, using the locally available CSV references files.

Usage

from headers import http, mime

...
request_headers.get(http.HOST) # provides access to the 'Host' header from the request
mail_headers.get(mime.Content_Location)
...

Other libraries

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-message-headers-2021.7.5.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_message_headers-2021.7.5-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file py-message-headers-2021.7.5.tar.gz.

File metadata

  • Download URL: py-message-headers-2021.7.5.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for py-message-headers-2021.7.5.tar.gz
Algorithm Hash digest
SHA256 6aa52d17ee638366bb72142466e65044cbbae0ac0b318b25431c7f34a016983c
MD5 c831a2ba5463f8bebce89398f0d501d6
BLAKE2b-256 496e2dc716a28d84022f2d3078b7b4c9b0a321478139cd4245d21cfc4f6d32c1

See more details on using hashes here.

File details

Details for the file py_message_headers-2021.7.5-py3-none-any.whl.

File metadata

  • Download URL: py_message_headers-2021.7.5-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for py_message_headers-2021.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eb28f2a8d6a17d6e36693e1d9eba9a03d086ee3219aba15db26e08e1d55e81d6
MD5 fca8899f2fca7f2a131c4e2379179d71
BLAKE2b-256 db4d2f0a950698fe298765df351d1347358308a4f9474a98d7958681cc959638

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page