Skip to main content

A simple HTTP/S client for Python written in rust

Project description

requests_rust

HTTP/s requests for python with rust

Description

it's a POC for a library in Python that sends requests and gets JSON responses written in Rust.

it's a public repo, exist on pypi and the name on pypi is requests-rust.

Prerequisites

  • python3.11
  • pip
  • wheel
  • setuptools
  • Linux[x86_64]/ windows[x86, x64] / Mac[x86_64, aarch64]

Features

  • written in rust
  • only works for sending and receiving JSON requests
  • always returns a JSON, no need to convert by using the JSON method
  • it's a POC

Installation

  1. by running pip install requests-rust
  2. download from actions artifacts latest one
  3. clone it and build using maturin (cargo)

Usage

By default, it returns JSON, if the server doesn't respond the status code will be 0.

send_request(METHOD, URL, [Optional]TIMEOUT, [Optional]DATA(as dict))
from requests_rust import send_request
res = send_request('GET', 'http://127.0.0.1:3000/')
print(res)

it supports these methods: GET, POST, PATCH, PUT, DELETE, HEAD

  • if call it with not define method it returns None
from requests_rust import send_request
res = send_request('TEST', 'http://127.0.0.1:3000/')
print(res)

output: None

Contributing

Contributions are welcome! Please follow the guidelines in CONTRIBUTING.md.

License

This project is licensed under the MIT License.

Contact

For any questions or feedback, please reach out to hamid@darabi.website.

Project details


Download files

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

Source Distribution

requests_rust-0.1.3.tar.gz (15.5 kB view details)

Uploaded Source

Built Distributions

requests_rust-0.1.3-cp312-none-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12 Windows x86-64

requests_rust-0.1.3-cp312-none-win32.whl (1.1 MB view details)

Uploaded CPython 3.12 Windows x86

requests_rust-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

requests_rust-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

requests_rust-0.1.3-cp311-none-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11 Windows x86-64

requests_rust-0.1.3-cp311-none-win32.whl (1.1 MB view details)

Uploaded CPython 3.11 Windows x86

requests_rust-0.1.3-cp311-cp311-manylinux_2_34_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

requests_rust-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

requests_rust-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

requests_rust-0.1.3-cp310-none-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

requests_rust-0.1.3-cp310-none-win32.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86

File details

Details for the file requests_rust-0.1.3.tar.gz.

File metadata

  • Download URL: requests_rust-0.1.3.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.5.1

File hashes

Hashes for requests_rust-0.1.3.tar.gz
Algorithm Hash digest
SHA256 85732ae7db29102bcac6420a7864782fabad9a11f7a5a51f1c13ccf90f7ff6b0
MD5 106915808142653c382d2b89bb58d033
BLAKE2b-256 0ffc21f60ad6cdaaa607c41d36b3065cca5db176024d1280f95474f3622f35ef

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 be86910f6cdb2d13f13db58d1fad2b6ee503c74875d13703f6eb2b05552280f0
MD5 729bc8457a38ca5025424ca43b4eee36
BLAKE2b-256 8c2f4bc115f290dc9b922bd7f695d2bbe5b29ebcbbbb5fb5fc376f09d68990c2

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp312-none-win32.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp312-none-win32.whl
Algorithm Hash digest
SHA256 fa1b3e779bd9c88aa7e0b426d8401ec0137be5929f9a17cd19104618667d159f
MD5 9f3c8be9867429de65bab626f3aac785
BLAKE2b-256 aaf61188bbb17bbbaad4b9a1a391f8d9e0520155b86f9f95c98a46fad7fd4eb9

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12b44b9b22b116fde97ef59c184570fe3807c0af16bdb3207af01b2963e3d2fd
MD5 69c58732b5fb86b7753c20866b9bafb2
BLAKE2b-256 e81aa4188985c347bcfc4d50fd03c235576d5257d3e36d794aeb7e9bc8dbc11e

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 10d8e778b39fe74d6db85e52df44cdebd4cf19fc0fd2458e64db50a0be8d28df
MD5 542b36600bd3e610ce28b0e46f61a614
BLAKE2b-256 4dbdae213413ac7e5e62a1f32c5b31872b8925239d9bbe7a1555878fbf793608

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 a4551d1194be6be5624ed52aea8d931524bbb21cd823659eb9226630e4636f7a
MD5 1aec18d3529dd840b645dcd17de7265a
BLAKE2b-256 e62f277d515e49de30d09404ca60ed975f0560152167a03abf585691a95fc9ff

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp311-none-win32.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp311-none-win32.whl
Algorithm Hash digest
SHA256 53cd71153469bbde5a3e65d4b3fe36f1b7da5a8b1dbf836efde6dd3068c77546
MD5 8bd8267e58a734968322e7798b3f0eb1
BLAKE2b-256 64509794c5c3df7aebb556ebbdc2067117b8c8d4bb1143dca23fb2ea07b3f788

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4db149fbf84c2e7d9dd086498a15765104d369148e2c9871ae09a75c52d8db76
MD5 93d5be654481e6a833bf998c14e98823
BLAKE2b-256 e273cd0482197dd91255b12c543973f002f2aa08f3e2cfdcdf15a8788e7c5c88

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f9a28100cfe649433b060946e688cd4eca7fc816902d407246259df23b7bba7
MD5 b0d06261256b357c84871d1c81b95080
BLAKE2b-256 35b8332b7fd67dace010fe26a7e788c7d233f2048e7da440132bdf5866dea74d

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cc84e9704ccc42ed5a6e3661b946805510b5a72d3a965d35e8174fec6d488365
MD5 c2137de99a85c875db258c029d0ca489
BLAKE2b-256 7aceee1d0c754dc67d95fd0c16d0749351372cab231bed78ec18dd2abaf51a6c

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 87837b84d00ac449287c125894b19137b060069f33c26e5b8b2eddcfa351fe7a
MD5 7ae248352333cd11e8fc15f69bf41979
BLAKE2b-256 b8f5ff3d7e0adb035f5500540e3ec4251a321cf28083964092c6ceeeecf503e3

See more details on using hashes here.

File details

Details for the file requests_rust-0.1.3-cp310-none-win32.whl.

File metadata

File hashes

Hashes for requests_rust-0.1.3-cp310-none-win32.whl
Algorithm Hash digest
SHA256 059e47c2cca6f06eb06c7620453167dfac8e311ed46c8954400dab5dd9bf59d4
MD5 e8c765ac997d6ab23a156d068c22be87
BLAKE2b-256 4951250f35bc369554537893302cffc7dc2b6ae54eb202ae5c8bff0c35e3738a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page