A Python library for seamless integration with DetaSpace in Flask
Project description
Version 0.1.1
⚠️ This is the initial version 0.1.0 and is currently in the alpha stage. It is not recommended for professional production use.
Welcome to FlaskDeta Docs!
Flask-Deta is a Python library that simplifies the integration of your DetaSpace collection of database and/or drive files with Flask framework.
With 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, making data and file management for your web projects convenient.
In this documents, we will provide you with an in-depth overview of Flask-Deta and help you get started using this extraordinary tool.
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.
Install
pip install flask-deta
QuickStart
-
Create a Flask App: Begin by creating an instance of the Flask app in your Python code.
-
Set Configuration Parameters: Set the required parameters, such as your Deta project key, Base name, and Drive name.
-
Create DetaBase and DetaDrive Instances: Create instances of DetaBase and DetaDrive using your Flask
app
as an argument.
DetaBase
from flask import Flask
from flask_deta import DetaBase
app = Flask(__name__)
# Set the DetaSpace project key and database name
app.config["DETA_PROJECT_KEY"] = "MyKey12345"
app.config["BASE_NAME"] = "products" # DetaSpace Base for data
# Create instance of DetaBase
base = DetaBase(app)
DetaDrive
from flask import Flask
from flask_deta import DetaDrive
app = Flask(__name__)
# Set the DetaSpace project key and drive name
app.config["DETA_PROJECT_KEY"] = "MyKey12345"
app.config["DRIVE_NAME"] = "icons" # DetaSpace Drive for files
# Create instances of DetaDrive
dd = DetaDrive(app)
DetaBase + DetaDrive
Integrate the features of DetaBase and DetaDrive seamlessly into your Flask application with. These components enable efficient storage and management of data and files within your project using DetaSpace.
from flask import Flask
from flask_deta import DetaBase, DetaDrive
app = Flask(__name__)
# Set the DetaSpace project key and drive name
app.config["DETA_PROJECT_KEY"] = "MyKey12345"
app.config["BASE_NAME"] = "products" # DetaSpace Base for data
app.config["DRIVE_NAME"] = "icons" # DetaSpace Drive for files
# Create instances of DetaDrive
db = DetaBase(app)
dd = DetaDrive(app)
For comprehensive details on the usage and available methods, refer to our documentation: DetaBase & DetaDrive.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flask_deta-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0011f4ebc1d0f7e646538dc79196c8096acf81446c700d731551188b98760b15 |
|
MD5 | 9ee1d6c77ad307589b269428d47f5c1a |
|
BLAKE2b-256 | a0550db14c564a7baafcdb499672be4020bb5e0b559a23b1183c6954ae93c9b4 |