Registry / web-framework / invenio-rest

invenio-rest

JSON →
library4.0.0pypypi✓ verified 84d ago

REST API module for Invenio, providing content negotiation, REST endpoints registration, and error handling. Current version 3.0.1, compatible with Python >=3.7. Development is ongoing but release cadence is irregular.

pip install invenio-rest
INSTALL
IMPORT
SIG · INVENIO-REST
I
invenio-rest
web-frameworkpythonv4.0.0
Install
10.2s avg
Import
514ms
Disk
142MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.0.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.540s · 143.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 10.2s · import 0.488s · 142MB
142MB installed
● package 142MB
Code
Verified usage

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

InvenioREST
from invenio_rest import InvenioREST
ContentNegotiatedMethodView
from invenio_rest.views import ContentNegotiatedMethodView
from invenio_rest.views import ContentNegotiatedMethodView as SomethingElse
Common misuse: aliasing the class unnecessarily may break registration
create_api_blueprint
from invenio_rest.views import create_api_blueprint

Initialize InvenioREST with a Flask app the usual way.

from flask import Flask from invenio_rest import InvenioREST app = Flask(__name__) ext = InvenioREST(app) @app.route('/api/hello') def hello(): return {'message': 'Hello, World!'} if __name__ == '__main__': app.run()
Debug
Known issues
breakingVersion 2.0.0 removed the deprecated 'invenio-rest' endpoint registration functions. Use 'invenio_rest.views.create_api_blueprint' instead.
fix
Update imports and replace old registration calls with create_api_blueprint.
affects: >=2.0.0
gotchaContent negotiation is case-sensitive. Ensure Accept headers match registered formats exactly (e.g., 'application/json' not 'Application/JSON').
fix
Use lowercase and correct format strings in Accept headers.
affects: all
deprecatedThe 'invenio_rest.errors' module is deprecated since 3.0.0. Use Flask's built-in error handling or 'invenio_rest.error_handlers'.
fix
Replace from invenio_rest.errors import ... with from invenio_rest.error_handlers import ...
affects: >=3.0.0
Errors
Common errors & fixes
AttributeError: module 'invenio_rest' has no attribute 'InvenioREST'
The extension class may not be imported if using an older version (<1.0) or incorrect spelling.
fix
Ensure you have version >=1.0.0 and use: from invenio_rest import InvenioREST
ImportError: cannot import name 'create_api_blueprint' from 'invenio_rest.views'
The function was renamed in version 2.0.0.
fix
Check your version. If >=2.0.0, use: from invenio_rest.views import create_api_blueprint
Upgrade
Version history
4.0.0latest on PyPI · released Jun 17, 2026
Audit
Dependencies
FlaskrequiredCore web framework
webargsrequiredArgument parsing for REST endpoints
marshmallowrequiredSchema serialization/deserialization
Agent activity
8 hits · last 30 days
node
8
Resources
invenio-rest — pip install invenio-rest · libregistry