English description follows Japanese.
概要
reqreq は、非常に簡潔な記述で複数の HTTP リクエスト(GET/POST)を並列に送信できる Python ライブラリです。サーバーとの通信を高速化したい場面で特に有効です。個人開発やスクリプト用途に適した設計で、直感的な構文が特徴です。
主な特徴
- 複数の HTTP リクエストを並列実行
- GET/POST を簡潔な記法で指定可能
- レスポンスの形式やエラー時の挙動を柔軟に制御可能
requestsモジュールとの互換性あり
主な用途
- Web サービスとの通信を高速化したいとき
- 複数個の API へ一括アクセスを行いたいとき
使い方
基本的な使い方(GET)
import reqreq
resp = reqreq(["https://example.com", "https://example-2.com"])
print(resp) # -> ['1つめのレスポンスの文字列', '2つめのレスポンスの文字列']
詳細な指定(GET/POST切り替え)
resp = reqreq([
{"url": "https://example.com", "method": "GET"},
{"url": "https://example.com", "method": "POST", "data": {"test": "test"}},
])
省略・簡易記法
resp = reqreq([
"https://example.com", # GET はURLだけでOK
["https://example.com", "POST", {"test": "test3"}], # リスト形式でも指定できる
("https://example.com", "POST", {"test": "test2"}), # タプル形式でも指定できる
["https://example.com", "post", {"test": "test3"}], # method名は小文字でもOK
])
オプション引数
resp = reqreq(
["https://example.com"],
resp_format = "raw", # "text" (デフォルト), または "raw" で requests.Response を取得
error = None, # 例外時に None を返す(デフォルト)
# error = "raw" にすると、例外オブジェクトをそのまま返す
)
注意点
- 非同期ライブラリではありません(内部ではスレッドベースの並列処理を行います)
- エラーハンドリングは簡易的で、例外を捕捉する場合は
error="raw"を明示してください - POST の
dataはrequestsと同様の形式で渡します
Overview
reqreq is a minimalistic Python library for sending multiple HTTP requests (GET/POST) in parallel with concise syntax. It’s designed for use cases where communication with web services needs to be fast, such as in personal projects or data scripts.
Features
- Parallel execution of multiple HTTP requests
- Extremely concise syntax for both GET and POST
- Customizable response format and error handling
- Compatible with
requestsresponse objects
Typical Use Cases
- Speeding up communication with your backend service
- Sending multiple API calls at once
Usage
Basic (GET requests)
import reqreq
resp = reqreq(["https://example.com", "https://example-2.com"])
print(resp) # -> ['Response from the first URL', 'Response from the second URL']
Detailed request specification
resp = reqreq([
{"url": "https://example.com", "method": "GET"},
{"url": "https://example.com", "method": "POST", "data": {"test": "test"}},
])
Compact notation
resp = reqreq([
"https://example.com", # Shorthand for GET
("https://example.com", "post", {"test": "test2"}), # Tuple style
["https://example.com", "POST", {"test": "test3"}], # List style also accepted
])
Additional options
resp = reqreq(
["https://example.com"],
resp_format = "raw", # "text" (default) or "raw" to get requests.Response objects
error = None, # Return None on error (default)
# error = "raw" returns the actual exception object
)
Notes
- This is not an async library; parallelism is thread-based.
- Error handling is simple; use
error="raw"if you want to inspect exceptions directly. - For POST data, use the same structure as the
requestslibrary.
Metadata
Release files for reqreq 0.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 | |
|---|---|---|---|---|
| reqreq-0.0.0.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| reqreq-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / reqreq-0.0.0.tar.gz
| Download URL | reqreq-0.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c9568057070d8bf656ad7d606d3a51252fe09e30c958165e0712ba99a5446ed
|
|
BLAKE2b-256 checksum How to use checksums |
e6a80041cd8c9c9b0665681cac9005323adc584b400a83b455c253232f846234
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.3
|
Release files / reqreq-0.0.0-py3-none-any.whl
| Download URL | reqreq-0.0.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df8558c50e69ab50e045fe28a98097604816b869e43b515f36e1238817c5a9eb
|
|
BLAKE2b-256 checksum How to use checksums |
32e317091c045d5c32de01520339e7a91da5075dc11130df8a4e1d9e37142aa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.3
|
Security for reqreq 0.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.
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.