Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyPI version Coverage Status Code style: black

httpxy

HTTP client with yaml support

Adds minor convenience features to the excellent httpx library which aims to make working with yaml easier and safer.

Installation

pip install httpxy

Features

  • Always use safe_load(). DONE
  • Response objects have a response.yaml() for deserializing YAML to a dict. DONE
  • Automatic serialization of objects to yaml. TODO
  • Automatic deserializing of yaml to python objects/classes/models. TODO
  • Works with multiple yaml packages. TODO

Examples

Deserialize directly from Response objects.

Equivalent to response.json().

import httpxy
from pprint import pprint

response = httpxy.get("https://mockbin.org/request", headers={"accept": "application/yaml"})

dict_from_yaml = response.yaml()

pprint(dict_from_yaml, sort_dicts=False, depth=1)
    {'startedDateTime': '2021-03-06T19:54:03.157Z',
     'clientIPAddress': '99.99.999.999',
     'method': 'GET',
     'url': 'https://mockbin.org/request',
     'httpVersion': 'HTTP/1.1',
     'cookies': None,
     'headers': {...},
     'queryString': {},
     'postData': {...},
     'headersSize': 559,
     'bodySize': 0}
print(response.text)
    startedDateTime: '2021-03-06T19:54:03.157Z'
    clientIPAddress: 99.99.999.999
    method: GET
    url: 'https://mockbin.org/request'
    httpVersion: HTTP/1.1
    cookies:
    headers:
      host: mockbin.org
      connection: close
      accept-encoding: gzip
      x-forwarded-proto: http
      cf-visitor: '{"scheme":"https"}'
      accept: application/yaml
      user-agent: python-httpx/0.17.0
    queryString: {}
    postData:
      mimeType: application/octet-stream
      text: ""
      params: []
    headersSize: 559
    bodySize: 0

Metadata

Release files for httpxy 0.0.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpxy 0.0.0a1
File Size Uploaded Provenance Actions
httpxy-0.0.0a1.tar.gz 4.1 kB Without provenance Details for httpxy-0.0.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for httpxy 0.0.0a1
File Interpreter ABI Platform Actions
httpxy-0.0.0a1-py3-none-any.whl Python 3 none any Details for httpxy-0.0.0a1-py3-none-any.whl

Total release size: 7.7 kB

Release files / httpxy-0.0.0a1.tar.gz

Download URL httpxy-0.0.0a1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eda54ed196f7a3bf4b14e54e3bd8b6c4fc0877eb05433caf2c15d3afb1c80f5c
BLAKE2b-256 checksum
How to use checksums
7c093f9b339bff5ecb1317c646cffa4bb690a7ed5dbb0e239e4595075c417a4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.9.1 Darwin/20.3.0

Release files / httpxy-0.0.0a1-py3-none-any.whl

Download URL httpxy-0.0.0a1-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ba6e0dfc8707cf58c0cc4c5b0ef99b7173441ad30962cbd33debad212ec2829
BLAKE2b-256 checksum
How to use checksums
9a383e759de054f9229a5e0f04712b67cea76a66e9f36f4fedac3cfaa81b9706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.9.1 Darwin/20.3.0

Security for httpxy 0.0.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page