{"id":32617700,"url":"https://github.com/shon/appbase","last_synced_at":"2025-10-30T17:02:54.600Z","repository":{"id":27938604,"uuid":"31431138","full_name":"shon/appbase","owner":"shon","description":"AppBase","archived":false,"fork":false,"pushed_at":"2022-03-29T07:00:39.000Z","size":185,"stargazers_count":7,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-17T06:02:36.822Z","etag":null,"topics":["api-server","python","webapp"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shon.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-27T17:37:25.000Z","updated_at":"2022-03-29T07:00:43.000Z","dependencies_parsed_at":"2022-09-11T15:20:58.118Z","dependency_job_id":null,"html_url":"https://github.com/shon/appbase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shon/appbase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shon%2Fappbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shon%2Fappbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shon%2Fappbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shon%2Fappbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shon","download_url":"https://codeload.github.com/shon/appbase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shon%2Fappbase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281844663,"owners_count":26571518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-server","python","webapp"],"created_at":"2025-10-30T17:02:43.348Z","updated_at":"2025-10-30T17:02:54.591Z","avatar_url":"https://github.com/shon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n=======\nAppbase\n=======\n\nCollection of components to make Python web app development easier and more fun.\n\nProblems \n========\n\nCommon problems appbase tries to solve\n\n- Need of fetching request arguments\n- Way to turn Python functions into HTTP/RESTish APIs\n- Error handling and logging\n- Input JSON validation\n- Input conversion\n- User and Role management json APIs\n    - Auth\n    - Only JSON APIs, no UI pages\n- Rate limiting\n- Host checks\n- Configurable process model (gevent/threads)\n\n\nNeed of fetching request arguments\n-----------------------------------\n\nUsual flask code\n~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    app = Flask(__name__)\n    \n    @app.route('/foo')\n    def bar():\n        arg1 = request.args.get('arg1')\n        arg2 = request.args.get('arg2')\n        arg3 = request.args.get('arg3')\n        do_something()\n\nAbove is tedious and is boring.\n\nflask-reqarg\n~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    app = Flask(__name__)\n\n    @app.route('/foo')\n    def bar(arg1, arg2, arg3):\n        do_something()\n\nAbove is much better code.. but do can we call bar() outside web request?\n\nappbase\n~~~~~~~~\n\n.. code-block:: python\n\n    def bar(arg1, arg2, arg3):\n        do_something()\n\n    app = Flask(__name__)\n\n    http_publisher = appbase.publishers.HTTPPublisher(app)\n    http_publisher.add_mapping('/bar/', add, ['POST'])\n   \n\nExisting solutions\n~~~~~~~~~~~~~~~~~~\n\n- flask-reqarg\n    - http://jason2506.github.io/flask-reqarg\n    - implicit\n    - no convertors\n\n- Webargs\n    - https://webargs.readthedocs.org/en/latest/#hello-webargs\n    - needs schema (not jsonschema)\n\n- appbase\n    - implicit\n    - post/json to args\n\n\nEase of creating REST APIs\n--------------------------\n- No automatic API creation from ORM Model\n\n\n\n\nREST API Creation::\n\n    \u003e\u003e\u003e import appbase.publishers\n\n    \u003e\u003e\u003e app = Flask(__name__)\n\n    \u003e\u003e\u003e rest_publisher = appbase.publishers.RESTPublisher(app)\n    \u003e\u003e\u003e handlers = (get_all, add_user, get_user, edit_user, delete_user)\n    \u003e\u003e\u003e rest_publisher.map_resource('users/', handlers, resource_id=('int', 'id'))\n\n\nProposals\n=========\n\n    \u003e\u003e\u003e def foofunc():\n    \u003e\u003e\u003e     return \n\n    \u003e\u003e\u003e foofunc.route = '/some/route'\n    \u003e\u003e\u003e foofunc.security = {groups: []}\n    \u003e\u003e\u003e foofunc.schema = {}\n\n    \u003e\u003e\u003e http_publisher = HTTPPublisher(app)\n    \u003e\u003e\u003e fooapi = http_publisher(foofunc)\n\n\nTests\n=====\n\nRunning tests::\n\n    # Start fake smtp server\n    python -m smtpd -n -c DebuggingServer localhost:10000\n    # OR python tests/fakemail.py --port 10000  # saves to .eml file in cwd\n\n    # Create your settings.py\n    cp settings-available/dev.py settings.py\n\n    # run tests\n    nosetests -xv tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshon%2Fappbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshon%2Fappbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshon%2Fappbase/lists"}