urlfetch

urlfetch is a simple, lightweight and easy to use HTTP client for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.
Highlights
Distributed as a single file module, has no dependencies other than the Python Standard Library.
Pure Python, works fine with gevent.
Small codebase, about 1300 lines, much of it comments and blank lines. Only 10 minutes you can know every detail.
Random user-agent.
Support streaming.
Installation
$ pip install urlfetch
Hello, world
import urlfetch
response = urlfetch.get('http://python.org/')
print(response.status, response.reason)
print(len(response.content))
Uploading files
import urlfetch
response = urlfetch.post(
'http://127.0.0.1:8888/upload',
headers = {
'Referer': 'http://127.0.0.1/',
},
files = {
'fieldname1': open('/path/to/file', 'rb'),
#'fieldname2': 'file content', # file must have a filename
'fieldname3': ('filename', open('/path/to/file2', 'rb')),
'fieldname4': ('filename', 'file content'),
},
data = {
'foo': 'bar'
},
)
print(response.status, response.content)
Testing
To run the tests, urlfetch relies on bottle and gunicorn. Install them and run:
$ python tests/testall.py
Metadata
Release files for urlfetch 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| urlfetch-3.0.0.tar.gz | 22.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| urlfetch-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.6 kB
Release files / urlfetch-3.0.0.tar.gz
| Download URL | urlfetch-3.0.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b818d89a0251ed9b1a8c3820548784cf6f3dfdb14d93afdaece939984fce1a4
|
|
BLAKE2b-256 checksum How to use checksums |
270474ce9e4ad7fb7292b5b5c9919dda0049224f4af90365bff49c191df80c7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / urlfetch-3.0.0-py3-none-any.whl
| Download URL | urlfetch-3.0.0-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ab5ed7f0cc89556c2211b031d5b30b40d1ecb0935b29e96c70337a098a7755d
|
|
BLAKE2b-256 checksum How to use checksums |
f7942b4658c9394c3dcbef9dfa21e0fd0a3ba234547033d283a7ac51eac15b57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logSecurity for urlfetch 3.0.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for urlfetch-3.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logA 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.