No project description provided
Project description
Pyxios
Fusing Python's requests with Javascript's axios.
Setup
Pyxios is a module that wraps requests methods in a single
instance, centralizing the settings of a given API. Let's use this
https://nonrealapi.com as an example:
from src.pyxios import Pyxios
non_real_api = Pyxios('https://nonrealapi.com/')
get_response = non_real_api.get()
post_response = non_real_api.post(json={'key': 'value'})
Basic Usage
There's no need to provide the base url address and default values of headers, cookies, timeout and/or proxies. The Pyxios instance has on method for each HTTP operation, allowing clarity and agility in the integration with Restfull APIs.
from src.pyxios import Pyxios
non_real_api = Pyxios(
'https://nonrealapi.com/',
headers={
'x-api-key': '$PRIMARY_KEY',
},
timeout=10,
)
get_response = non_real_api.get('resource/1')
delete_response = non_real_api.delete('resource/1', )
# Is also possible to override/update values in each request
patch_response = non_real_api.patch(
'resource/2',
headers={
'x-api-key': '$SECONDARY_KEY',
},
params={'key': 'value'},
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyxios-1.0.2.tar.gz.
File metadata
- Download URL: pyxios-1.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c920a536a326d2970b47c91231d35af7be069cdb4529593bbde0d0bd3e1b791
|
|
| MD5 |
337e6fb872aa8812ce9a9f5e60922126
|
|
| BLAKE2b-256 |
c21407bb47a5cceeb176c4333fcc84810f2a20087ea3d6aebcfec3bb8b65d863
|
File details
Details for the file pyxios-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pyxios-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
778a49dbcd83f9950a256a68c5196795167d8a2b312b0d2561e7d440419f100f
|
|
| MD5 |
b86bc2a1b3c31374dc31141318e8f68b
|
|
| BLAKE2b-256 |
971e96a7eb066747d131eac42faba081f0005ec0976f000bd33364c753a3f535
|