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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.772s · 21.3MB
glibcpy 3.10–3.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)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'jsonapi_requests'
Import typo: using dashes instead of underscores.
fixUse `import jsonapi_requests` (underscore).
AttributeError: module 'jsonapi_requests' has no attribute 'Api'
Importing submodule directly instead of package root.
fixUse `from jsonapi_requests import Api`.
jsonapi_requests.exceptions.InvalidConfigurationException: api_url is required
Api.config() called without 'api_url' key.
fixSet `'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.