Personal Interface
The Personal Interface is a Python project that provides a simple model for connecting to a database using the Deta library, among other utilities as loggers. It offers basic database operations such as querying, creating, updating, and deleting records. This README provides an overview of the project, installation instructions, and usage examples.
Table of Contents
Installation
Before you can use the Personal Interface, make sure you have Python installed on your system. You'll also need to set up a Deta project and obtain an API key. Follow these steps to get started:
-
Clone the repository:
pip install personal_interfaces
-
Set your Deta project API key as an environment variable:
Method 1
Using bash:
export DB_ACCESS_TOKEN=your_api_key
Method 2
Using a
.envDB_ACCESS_TOKEN = your_api_key
Replace
your_api_keywith your actual Deta API key. -
Set your private API key to access and use the code:
Method 1
Using bash:
export API_KEY=your_api_key
Method 2
Using a
.envAPI_KEY = your_api_key
Replace
your_api_keywith your actual Deta API key.
Usage
This interface can only be used with a private API_KEY. Without it, the tool is not functional.
DetaDatabase
The Personal Interface provides a simple way to interact with your Deta database. Here's how you can use it in your Python code:
-
Import the
DetaDatabaseclass:from personal_interfaces import DetaDatabase
-
Create an instance of the
DetaDatabaseclass and connect to your Deta database:db = DetaDatabase() db.connect("your_database_name")
Replace
"your_database_name"with the name of your Deta database. -
Perform database operations such as querying, creating, updating, and deleting records using the provided methods. For example:
# Query for records data = {"name": "John"} results = db.query(data, filter_by="equal") # Create a new record new_data = {"name": "Alice", "age": 30} key = db.create(new_data) # Update an existing record updated_data = {"key": key, "age": 31} db.update(updated_data) # Delete a record by its key db.delete(key)
For more details on how to use the Personal Interface, refer to the Python code documentation in the repository.
Contributing
Contributions to this project are welcome! If you have suggestions, feature requests, or would like to report a bug, please open an issue on the GitHub repository. If you'd like to contribute code, please fork the repository, make your changes, and submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Release files for personal-interfaces 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| personal_interfaces-0.4.2.tar.gz | 25.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| personal_interfaces-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.7 kB
Release files / personal_interfaces-0.4.2.tar.gz
| Download URL | personal_interfaces-0.4.2.tar.gz |
|---|---|
| Size | 25.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e63bba94f785e41fcd1f92f9903250eb266ddec0798242095b6efe92b99b339
|
|
BLAKE2b-256 checksum How to use checksums |
cefef60fb79396c6b6bccc5cdad89d3b3254764d90d1cbecaa724b99e5d4fddd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|
Release files / personal_interfaces-0.4.2-py3-none-any.whl
| Download URL | personal_interfaces-0.4.2-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2deffe1bc062da27d2dd103608b86cab7cb280a47c323b3fcb98073a7d468df
|
|
BLAKE2b-256 checksum How to use checksums |
925bd8c777f634ccb6b6e98d46e022d70ba689cf127bb11656d870fe90e960ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|