Registry / http-networking / jsonapi-requests

jsonapi-requests

JSON →
library0.8.0pypypi✓ verified 84d ago

A Python client implementation for JSON API (http://jsonapi.org/) specifications. Version 0.8.0 supports only Python >=3.9. Follows the JSON API standard for building API clients. Release cadence is low; maintainer activity is sparse.

pip install jsonapi-requests
INSTALL
IMPORT
SIG · JSONAPI-REQUESTS
J
jsonapi-requests
http-networkingpythonv0.8.0
Install
2.2s avg
Import
731ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.772s · 21.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.690s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JsonApiObject
from jsonapi_requests import JsonApiObject
from jsonapi_requests.data import JsonApiObject
Import path changed; previous deep paths no longer work.
Api
from jsonapi_requests import Api
from jsonapi_requests.api import Api
Direct import from package root.

Initializes the API client and fetches a JSON API resource. Replace api_url and id with actual values.

from jsonapi_requests import Api, JsonApiObject api = Api.config({ 'api_url': 'https://example.com/api', 'auth': ('user', 'pass') # optional }) # Example: fetch a single resource object = JsonApiObject.from_api(api, id='1', type='articles') print(object.attributes)
Debug
Known issues
gotchaThe library uses synchronous requests (requests library). It does not support async/await natively. Blocking I/O can be an issue in async applications.
fix
Wrap calls in async executor or use a different async-compatible JSON API client.
affects: all
deprecatedMethods like `get_object` and `get_list` on the Api object are deprecated in favor of using JsonApiObject and JsonApiList statically.
fix
Use `JsonApiObject.from_api(api, id, type)` and `JsonApiList.from_api(api, type)` instead.
affects: >=0.8.0
breakingPython 3.8 and below are no longer supported. Requires Python >=3.9.
fix
Upgrade Python to 3.9+.
affects: >=0.8.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'jsonapi_requests'
Import typo: using dashes instead of underscores.
fix
Use `import jsonapi_requests` (underscore).
AttributeError: module 'jsonapi_requests' has no attribute 'Api'
Importing submodule directly instead of package root.
fix
Use `from jsonapi_requests import Api`.
jsonapi_requests.exceptions.InvalidConfigurationException: api_url is required
Api.config() called without 'api_url' key.
fix
Set `'api_url': 'https://...'` in the config dictionary.
Upgrade
Version history
0.8.0latest on PyPI · released Jul 12, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jsonapi-requests — pip install jsonapi-requests · libregistry