{"id":21463,"library":"invenio-rest","title":"invenio-rest","description":"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.","status":"active","version":"3.0.1","language":"python","source_language":"en","source_url":"https://github.com/inveniosoftware/invenio-rest","tags":["invenio","rest","api","flask","content-negotiation"],"install":[{"cmd":"pip install invenio-rest","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Core web framework","package":"Flask","optional":false},{"reason":"Argument parsing for REST endpoints","package":"webargs","optional":false},{"reason":"Schema serialization/deserialization","package":"marshmallow","optional":false}],"imports":[{"note":null,"wrong":null,"symbol":"InvenioREST","correct":"from invenio_rest import InvenioREST"},{"note":"Common misuse: aliasing the class unnecessarily may break registration","wrong":"from invenio_rest.views import ContentNegotiatedMethodView as SomethingElse","symbol":"ContentNegotiatedMethodView","correct":"from invenio_rest.views import ContentNegotiatedMethodView"},{"note":null,"wrong":null,"symbol":"create_api_blueprint","correct":"from invenio_rest.views import create_api_blueprint"}],"quickstart":{"code":"from flask import Flask\nfrom invenio_rest import InvenioREST\n\napp = Flask(__name__)\next = InvenioREST(app)\n\n@app.route('/api/hello')\ndef hello():\n    return {'message': 'Hello, World!'}\n\nif __name__ == '__main__':\n    app.run()","lang":"python","description":"Initialize InvenioREST with a Flask app the usual way."},"warnings":[{"fix":"Update imports and replace old registration calls with create_api_blueprint.","message":"Version 2.0.0 removed the deprecated 'invenio-rest' endpoint registration functions. Use 'invenio_rest.views.create_api_blueprint' instead.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use lowercase and correct format strings in Accept headers.","message":"Content negotiation is case-sensitive. Ensure Accept headers match registered formats exactly (e.g., 'application/json' not 'Application/JSON').","severity":"gotcha","affected_versions":"all"},{"fix":"Replace from invenio_rest.errors import ... with from invenio_rest.error_handlers import ...","message":"The 'invenio_rest.errors' module is deprecated since 3.0.0. Use Flask's built-in error handling or 'invenio_rest.error_handlers'.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you have version >=1.0.0 and use: from invenio_rest import InvenioREST","cause":"The extension class may not be imported if using an older version (<1.0) or incorrect spelling.","error":"AttributeError: module 'invenio_rest' has no attribute 'InvenioREST'"},{"fix":"Check your version. If >=2.0.0, use: from invenio_rest.views import create_api_blueprint","cause":"The function was renamed in version 2.0.0.","error":"ImportError: cannot import name 'create_api_blueprint' from 'invenio_rest.views'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}