A python client for the memri Pod, and tools to create Plugins
Project description
Pymemri
Pymemri is a python library for creating Plugins for the Memri Personal online datastore (pod). Pymemri has a PodClient to communicate with the pod, and tools to build and test plugins.
Plugins connect and add the information to your Pod. Plugins that import your data from external services are called Importers (Gmail, WhatsApp, etc.). Plugins that connect new data to the existing data are called indexers (face recognition, spam detection, object detection, etc.). Lastly there are plugins that execute actions (sending messages, uploading files).
Installing
As a package
pip install pymemri
Development
To install the Python package for development, run:
pip install -e .
Contributing
If you would like to contribute to Pymemri, have a look at our contibuting guidelines to get started and join our Discord if you have any questions about using or contributing to the library.
Quickstart: Pod Client
All interaction between plugins and the pod goes via the Pymemri PodClient
. To use this client in development, we first need to have a pod running locally. The quickest way to do this is to install from the pod repo, and run ./examples/run_development.sh
.
If you have a running pod, you can define and add your own item definitions:
from pymemri.data.schema import Item
from pymemri.pod.client import PodClient
class Dog(Item):
name: Optional[str] = None
age: Optional[int] = None
# Connect to the pod and add the Dog item definition
client = PodClient()
client.add_to_schema(Dog)
# Add a Dog to the pod
dog = Dog(name="Rita", age=3)
client.create(dog)
Quickstart: Running a plugin
After installation, users can use the plugin CLI to manually run a plugin. For more information on how to build a plugin, see run_plugin
.
With the pod running, run in your terminal:
store_keys
run_plugin --metadata "example_plugin.json"
This stores a random owner key and database key on your disk for future use, and runs the pymemri example plugin. If everything works correctly, the output should read Plugin run success.
Docs
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
File details
Details for the file pymemri-0.1.2.tar.gz
.
File metadata
- Download URL: pymemri-0.1.2.tar.gz
- Upload date:
- Size: 66.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68310303d98feae6602cebcf56ac328a035b3d571a8ccea4fa735f2f57e4845f |
|
MD5 | d08c63263b677c57f7d6f03f6107a825 |
|
BLAKE2b-256 | aea7aba434acd4ddd00ece0f5dd3744e7abc243846c3ef137b73a4d9e2ea869d |
File details
Details for the file pymemri-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: pymemri-0.1.2-py3-none-any.whl
- Upload date:
- Size: 76.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2ccfb9bba6aa47076cea892fc697a0910afea8496ecdfb25a47dff7dfcbd976 |
|
MD5 | de48ae4a43f0f6e0907a4e2886ae625e |
|
BLAKE2b-256 | c86ffaff7a32bf40e05e4b49b2083fedf01e5b6b9ba1d133194b99df2269262a |