Skip to main content

urlfetch github-actions-badge furyio-badge docs-badge

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.

Documentation

https://ifduyue.github.io/urlfetch/

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.1

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

Source distribution (sdist)

Source distribution for urlfetch 3.0.1
File Size Uploaded Provenance Actions
urlfetch-3.0.1.tar.gz 23.1 kB With provenance Details for urlfetch-3.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 38.8 kB

Release files / urlfetch-3.0.1.tar.gz

Download URL urlfetch-3.0.1.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dfd2f3bd7ca96e31e0e662d508e0b13cdfcc31a360bf9daa53dd7847b1683573
BLAKE2b-256 checksum
How to use checksums
ce529633a09655a076cbcb631e26dc7f932581d73ba602f869736baeb6a58675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / urlfetch-3.0.1-py3-none-any.whl

Download URL urlfetch-3.0.1-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d508124473800ea8918e1cbaae8bc27d162f3a4abb344d41d577ef2fe3466ef
BLAKE2b-256 checksum
How to use checksums
81ef93761dfd0fe77dd46aefaa6fc8ca56cbfe342a99867470c1fa4d202f3805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Security for urlfetch 3.0.1

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.

Select from 2 files

Attestation for urlfetch-3.0.1.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 Nov 1, 2026.

Transparency log

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

3.0.1 This release

2 release files Full provenance

1.0.1

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