{"id":23523991,"url":"https://github.com/jesparzarom/flask-deta","last_synced_at":"2026-01-30T02:02:01.168Z","repository":{"id":187275604,"uuid":"674831092","full_name":"Jesparzarom/Flask-Deta","owner":"Jesparzarom","description":"[DEPRECATED] Python library that simplifies the integration of your DetaSpace collection of database and/or drive files with Flask framework.","archived":false,"fork":false,"pushed_at":"2024-11-05T19:13:10.000Z","size":1452,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T03:02:00.497Z","etag":null,"topics":["deta","deta-base","deta-drive","deta-space","detash","drive","flask","flask-application","nosql","nosql-database","python","python3","web-application","web-development"],"latest_commit_sha":null,"homepage":"https://flask-deta.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jesparzarom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Jesparzarom","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-08-04T22:45:48.000Z","updated_at":"2024-11-05T19:13:13.000Z","dependencies_parsed_at":"2024-11-05T19:29:07.058Z","dependency_job_id":"1547b58e-430e-4eb1-99a8-4a368b4d780f","html_url":"https://github.com/Jesparzarom/Flask-Deta","commit_stats":null,"previous_names":["jesparzarom/flask-deta"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesparzarom%2FFlask-Deta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesparzarom%2FFlask-Deta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesparzarom%2FFlask-Deta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesparzarom%2FFlask-Deta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jesparzarom","download_url":"https://codeload.github.com/Jesparzarom/Flask-Deta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249824258,"owners_count":21330286,"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","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":["deta","deta-base","deta-drive","deta-space","detash","drive","flask","flask-application","nosql","nosql-database","python","python3","web-application","web-development"],"created_at":"2024-12-25T18:13:16.268Z","updated_at":"2026-01-30T02:02:01.046Z","avatar_url":"https://github.com/Jesparzarom.png","language":"Python","funding_links":["https://github.com/sponsors/Jesparzarom"],"categories":[],"sub_categories":[],"readme":"# ⚠️ Deprecation Notice\n\n**Important:** This project is now deprecated and no longer maintained due to the discontinuation of Deta Base, which is a critical dependency.\n\n### Reason for Deprecation\nDeta, the platform supporting the database used by this module, has announced that they will cease operations for their services as of **October 17, 2024**. Starting from that date, all hosted apps, installed apps, horizons, websites, and data will be removed.\n\n\u003e \"Space will keep running for 45 days until October 17, 2024. We will then start removing all apps (hosted or installed), horizons, websites and data.\n\u003e\n\u003e You can continue to login until sunset. We've built tools to export your data (and code for developers).\"\n\nFor more details on Deta's announcement, please refer to their [official statement](https://flask-deta.readthedocs.io/en/stable/).\n\n### Recommended Actions\n- **Backup your data**: Ensure you have exported any necessary data and code before October 17, 2024, using the tools provided by Deta.\n- **Explore Alternatives**: Consider migrating to other database solutions that align with your project's needs.\n\nWe appreciate your understanding and thank you for your support.\n\n---\n\n# flask-Deta Readme [Archive]\n[![Documentation Status](https://readthedocs.org/projects/flask-deta/badge/?version=latest)](https://flask-deta.readthedocs.io/en/latest/?badge=latest)\n[![PyPI Version](https://img.shields.io/pypi/v/flask-deta)](https://pypi.org/project/flask-deta/)\n[![License](https://img.shields.io/pypi/l/Flask-Deta)](https://pypi.org/project/Flask-Deta/)\n[![Downloads](https://static.pepy.tech/badge/flask-deta)](https://pepy.tech/project/flask-deta)\n[![Dependencies](https://img.shields.io/librariesio/release/pypi/flask-deta)](https://libraries.io/pypi/flask-deta)\n[![GitHub Issues](https://img.shields.io/github/issues/Jesparzarom/Flask-Deta)](https://github.com/Jesparzarom/Flask-Deta/issues)\n\n\n\n## Version 0.2.1\n\u003e ⚠️ This is the initial version 0.2.1 and is currently in the alpha stage. It is not recommended for production use.\n\n---\n\n**Welcome to FlaskDeta README!**\n\n**For a more detailed use, I recommend you to visit the [Flask-Deta documentation](https://flask-deta.readthedocs.io/en/latest/)**\nSee [flask-deta on pypi](https://pypi.org/project/flask-deta/)\n\nFlask-Deta is a Python library that simplifies the integration of your [DetaSpace](https://deta.space/) collection of database and/or drive files with [Flask](https://flask.palletsprojects.com/en/2.3.x/) framework. \n\nWith Flask-Deta, you can store and manage data with `DetaBase` and handle file storage operations with `DetaDrive`, all within the context of your Flask application. This robust combination allows you to leverage the secure and scalable cloud infrastructure of [DetaSpace](https://deta.space/), making data and file management for your web projects convenient. \n\nIn this documents, we will provide you with an in-depth overview of Flask-Deta and help you get started using this extraordinary tool.\n\n\u003e We'd like to inform you that not all DetaSpace functionalities are currently integrated, both in Drive and Base. However, we are working on gradually incorporating them to create a robust integration package between Flask and DetaSpace. Our aim is to enhance your development experience by leveraging the full potential of this integration.\n\n- To learn more about DetaSpace visit the [DetaSpace documentation](https://deta.space/docs/en/).\n- To learn more about Flask visit the [Flask documentation](https://flask.palletsprojects.com/en/2.3.x/).\n\n# Install\nInstallation through pip. See [flask-deta on pypi](https://pypi.org/project/flask-deta/)\n```shell\npip install flask-deta\n```\n\n# QuickStart\n\n1. **Create a Flask App:** Begin by creating an instance of the Flask app in your Python code.\n\n2. **Set Configuration Parameters:** Set the required parameters, such as your Deta project key, Base name, and Drive name.\n\n3. **Create DetaBase and DetaDrive Instances:** Create instances of DetaBase and DetaDrive using your Flask `app` as an argument.\n\n\n## DetaBase\n```python\nfrom flask import Flask\nfrom flask_deta import DetaBase\n\napp = Flask(__name__)\n\n# Set the DetaSpace project key and database name\napp.config[\"DETA_PROJECT_KEY\"] = \"MyKey12345\"\napp.config[\"BASE_NAME\"] = \"products\" # DetaSpace Base for data \n\n# Create instance of DetaBase\nbase = DetaBase(app)\n\n# DetaBase.get_all()\n@app.route(\"/data\")\ndef all_records():\n    data = base.get_all()\n    return data\n\nif __name__ == \"__main__\":\n    app.run(debug=True)\n```\n\n## DetaDrive\n```python\nfrom flask import Flask\nfrom flask_deta import DetaDrive\n\napp = Flask(__name__)\n\n# Set the DetaSpace project key and drive name\napp.config[\"DETA_PROJECT_KEY\"] = \"MyKey12345\"\napp.config[\"DRIVE_NAME\"] = \"icons\" # DetaSpace Drive for files\n\n# Create instances of DetaDrive\ndrive = DetaDrive(app)\n\n# DetaDrive.all_files()\n@app.route(\"/files\")\ndef all_files():\n    files = drive.all_files()\n    return files\n\nif __name__ == \"__main__\":\n    app.run(debug=True)\n```\n\n## DetaDrive + DetaBase\n```python\nfrom flask import Flask\nfrom flask_deta import DetaBase, DetaDrive\n\napp = Flask(__name__)\n\n# Set the DetaSpace project key, database name and drive name\napp.config[\"DETA_PROJECT_KEY\"] = \"MyKey12345\"\napp.config[\"BASE_NAME\"] = \"products\" # DetaSpace Base for data \napp.config[\"DRIVE_NAME\"] = \"icons\" # DetaSpace Drive for files\n\n# Create instances of DetaDrive and DetaBase\nbase = DetaBase(app)\ndrive = DetaDrive(app)\n\n# DetaBase.get_all()\n@app.route(\"/data\")\ndef all_records():\n    data = base.get_all()\n    return data\n\n# DetaDrive.all_files()\n@app.route(\"/files\")\ndef all_files():\n    files = drive.all_files()\n    return files\n\nif __name__ == \"__main__\":\n    app.run(debug=True)\n```\n\n## Using `init_app()`\nTo ensure modularity and easy integration, the `init_app()` method is provided for initializing both DetaBase and DetaDrive separately. This approach allows you to configure and associate the extensions with your Flask application in a standardized manner.\n\n### DetaBase.`init_app`\n```python\nfrom flask import Flask\nfrom flask_deta import DetaBase\n\napp = Flask(__name__)\n\n# Set the DetaSpace project key and database name\napp.config[\"DETA_PROJECT_KEY\"] = \"MyKey12345\"\napp.config[\"BASE_NAME\"] = \"products\" # DetaSpace Base for data \n\n# Create an instance of DetaBase\nbase = DetaBase()\n\n@app.route(\"/all\")\ndef all_data():\n    data = base.get_all()\n    return data\n\nbase.init_app(app)\n\nif __name__ == \"__main__\":\n    app.run(debug=True)\n```\n\n### DetaDrive.`init_app`\n```python\nfrom flask import Flask\nfrom flask_deta import DetaDrive\n\napp = Flask(__name__)\n\n# Set the DetaSpace project key and drive name\napp.config[\"DETA_PROJECT_KEY\"] = \"MyKey12345\"\napp.config[\"DRIVE_NAME\"] = \"icons\" # DetaSpace Drive for files\n\n# Create an instance of DetaDrive\ndrive = DetaDrive()\n\n@app.route(\"/files\")\ndef files():\n    files = drive.all_files()\n    return files\n\ndrive.init_app(app)\n\nif __name__ == \"__main__\":\n    app.run(debug=True)\n```\n\n### DetaBase.init_app + DetaDrive.init_app\n```python\napp = Flask(__name__)\n\n# Set the DetaSpace project key and drive name\napp.config[\"DETA_PROJECT_KEY\"] = \"MyKey12345\"\napp.config[\"BASE_NAME\"] = \"products\"  # DetaSpace Base for data\napp.config[\"DRIVE_NAME\"] = \"icons\"  # DetaSpace Drive for files\n\n# Create instances of DetaDrive and DetaBase\nbase = DetaBase()\ndrive = DetaDrive()\n\n# Home\n@app.route(\"/\")\ndef home():\n    links = \"\"\"\n    \u003chead\u003e\n        \u003ctitle\u003eFlask-Deta\u003c/title\u003e\n        \u003cstyle\u003e\n            body {\n                background: antiquewhite;\n                color: white;\n                font-family: Arial, sans-serif;\n                text-align: center;\n            }\n\n            h1 {\n                color: darkslateblue;\n            }\n\n            a {\n                display: block;\n                margin: 10px auto;\n                padding: 10px;\n                width: 200px;\n                background-color: deepskyblue;\n                color: white;\n                text-decoration: none;\n                border-radius: 5px;\n                transition: background-color 0.3s ease-in-out;\n            }\n\n            a:hover {\n                background-color: dodgerblue;\n            }\n        \u003c/style\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch1\u003eWelcome to Flask-Deta\u003c/h1\u003e\n        \u003cdiv\u003e\n            \u003ca href=\"/data\" target=\"_blank\"\u003e\n                Get all data list\n            \u003c/a\u003e\n            \u003ca href=\"/files\" target=\"_blank\"\u003e\n                Get all files list\n            \u003c/a\u003e\n        \u003c/div\u003e\n    \u003c/body\u003e\n    \"\"\"\n    return links\n\n\n# DetaBase.get_all()\n@app.route(\"/data\")\ndef all_records():\n    data = base.get_all()\n    return data\n\n# DetaDrive.all_files()\n@app.route(\"/files\")\ndef all_files():\n    files = drive.all_files()\n    return files\n\n\nbase.init_app(app)\ndrive.init_app(app)\n\n\n\n\nif __name__ == \"__main__\":\n    app.run(debug=True)\n```\n\n\n\n---\n\nVisit the [Flask-Deta documentation](https://flask-deta.readthedocs.io/en/latest/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesparzarom%2Fflask-deta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjesparzarom%2Fflask-deta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesparzarom%2Fflask-deta/lists"}