Skip to main content

Note: A new, lighterweight, more modern replacement: ho

(Http) Requests for humans

Documentation here

the_one_where_we_have_an_http_service_that_we_want_call_through_normal_looking_python_functions

Tools to create python binders to http web services. Here, we develop python data access to web content through http request such as web services or web pages.

The story is as follows: You found something on the web that you'd like to interact with.

  • This could be data you'd like to have access to,
  • or some actions you'd like to perform -- such as search, posting an article, buying some bitcoin, etc..
  • If you're really lucky, someone's already written a python layer to do what you want to do.
  • If you're just lucky, the resource comes with a clear interface definition that makes it easy for you to write your own python for.
  • If you're less lucky, you'll have to decipher some bad documentation of the API, or even write your own bots, crawlers and parsers to get what you want.

We want to make that all easier for you.

What we'll focus on for now is the fundamental common aspect of making a python layer to the http requests.

"But... the excellent requests library already provides the python wrapper to http!" you say. Yes, and we thank the requests developers for that. It is indeed an excellent package that we won't have to write now!

We'd like to build from there, cover more annoying boilerplate, and get you closer, faster, to the functionality you actually need: Functions with the python types you're using in your code, that responds with python objects you can directly use in your code.

The development of requests (including the recommended add-ons) could be said to be facing the metal (raw http mechanics) and building interfaces with humans in mind. By contrast, we want to face the human and build adapters to communicate with the metal. That is, in our case, the fact that http is under the hood shouldn't even be visible (unless it needs to).

It's in honor of the inspiration of "designing for humans" that we extend requests' tag-line, to "requests for humans".

The approach

As always, we favor expressiveness, boilerplate minimization, separation of concerns, and a layered approach that incrementally transforms and enhance to get us from where we are to where we want to be.

So for py2request, where are we and where do we want to be?

What we have: We have some http accessible resources. For instance, a perfectly well structured API specification of a REST webservice, a very messy website, or anything in between.

What we'd like: A Python interface to these web stuff. That is, we want to talk python to the resources, and have it talk python back to us. Further, we want this conversation to be to the point; we don't want to have to say more than the exact necessary, and don't want responses containing anything but exactly what we want and how we want it. Finally, we'd like to get this with minimum effort -- letting default choices be made for us, but being able to make our own choices if we want.

Is that too much to ask?

In the layered approach we'll go from function specifications, to functions returning python Request objects, which we can then wrap further to create functions actually executing the request, getting back a Response object, and wrap further to get the final python output type.

So the objects in this pipeline are:

  • Specification
  • Request
  • Response
  • Final python object

Download files

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

Source Distribution

http2py-0.1.33.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

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

http2py-0.1.33-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file http2py-0.1.33.tar.gz.

File metadata

  • Download URL: http2py-0.1.33.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for http2py-0.1.33.tar.gz
Algorithm Hash digest
SHA256 678da6b8762360ab48fc6c2bbd6e587d5fb4fbbcfc9d2864402c1cafcc2da04d
MD5 f57a91b59469e65aa5b182ac4e6a7b16
BLAKE2b-256 0a2155bf60feb31f79a5061df6f63a0a241cd1838494d39957f87f109dd4005a

See more details on using hashes here.

File details

Details for the file http2py-0.1.33-py3-none-any.whl.

File metadata

  • Download URL: http2py-0.1.33-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for http2py-0.1.33-py3-none-any.whl
Algorithm Hash digest
SHA256 f5ffa4464c620d7d33a4af3d047ef23add73ca9ee2884ca44149c148ce46bb21
MD5 9b2cdedb3fc1dbf77a87e610788e2001
BLAKE2b-256 6d42d361797bc8d4641077bdda49df6a1016647cae9a2bdc059f8d07702c6f4d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.33 This release

2 files

0.1.31

1 file

0.1.30

1 file

0.1.29

1 file

0.1.28

1 file

0.1.27

1 file

0.1.26

1 file

0.1.25

1 file

0.1.24

1 file

0.1.23

1 file

0.1.22

1 file

0.1.21

1 file

0.1.20

1 file

0.1.19

1 file

0.1.18

1 file

0.1.17

1 file

0.1.16

1 file

0.1.15

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

2 files

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