# Pymemri
> Pymemri is a python library for creating <b>Plugins</b> for the Memri Personal online datastore <a href='https://gitlab.memri.io/memri/pod'>(pod)</a>. Pymemri has a PodClient to communicate with the pod, and tools to build and test plugins.
[![Gitlab pipeline status (self-hosted)](https://img.shields.io/gitlab/pipeline/memri/pymemri/dev?gitlab_url=https%3A%2F%2Fgitlab.memri.io&label=CI&logo=gitlab&style=plastic)](https://gitlab.memri.io/memri/pymemri/-/pipelines/latest)
[![Discord](https://img.shields.io/discord/799216875480678430?color=blue&label=Discord&logo=discord&style=plastic)](https://discord.gg/BcRfajJk4k)
[![Twitter URL](https://img.shields.io/twitter/url?label=%40YourMemri&logo=twitter&style=plastic&url=https%3A%2F%2Ftwitter.com%2FYourMemri)](https://twitter.com/YourMemri)
<a href="https://pypi.org/project/pymemri/"><img src="https://pepy.tech/badge/pymemri" /></a>
Plugins connect and add the information to your Pod. Plugins that <b>import your data from external services</b> are called **Importers** (Gmail, WhatsApp, etc.). Plugins that <b>connect new data to the existing data</b> are called **indexers** (face recognition, spam detection, object detection, etc.). Lastly there are plugins that <b>execute actions</b> (sending messages, uploading files).
## Installing
### As a package
```bash
pip install pymemri
```
### Development
To install the Python package for development, run:
```bash
pip install -e .
```
## Contributing
If you would like to contribute to Pymemri, have a look at our [contibuting guidelines](CONTRIBUTING.md) 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](https://gitlab.memri.io/memri/pod), and run `./examples/run_development.sh`.
If you have a running pod, you can define and add your own item definitions:
```python
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`.
<b>With the pod running, run in your terminal: </b>
```bash
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
[pymemri docs](https://docs.memri.io/component-architectures/plugins/readme/)
Raw data
{
"_id": null,
"home_page": "https://gitlab.memri.io/memri/pymemri",
"name": "pymemri",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "memri privacy personal data client python",
"author": "Memri",
"author_email": "koen.vanderveen@polis.global",
"download_url": "https://files.pythonhosted.org/packages/ae/a7/aba434acd4ddd00ece0f5dd3744e7abc243846c3ef137b73a4d9e2ea869d/pymemri-0.1.2.tar.gz",
"platform": null,
"description": "# Pymemri\n> Pymemri is a python library for creating <b>Plugins</b> for the Memri Personal online datastore <a href='https://gitlab.memri.io/memri/pod'>(pod)</a>. Pymemri has a PodClient to communicate with the pod, and tools to build and test plugins.\n\n\n[![Gitlab pipeline status (self-hosted)](https://img.shields.io/gitlab/pipeline/memri/pymemri/dev?gitlab_url=https%3A%2F%2Fgitlab.memri.io&label=CI&logo=gitlab&style=plastic)](https://gitlab.memri.io/memri/pymemri/-/pipelines/latest)\n[![Discord](https://img.shields.io/discord/799216875480678430?color=blue&label=Discord&logo=discord&style=plastic)](https://discord.gg/BcRfajJk4k)\n[![Twitter URL](https://img.shields.io/twitter/url?label=%40YourMemri&logo=twitter&style=plastic&url=https%3A%2F%2Ftwitter.com%2FYourMemri)](https://twitter.com/YourMemri)\n<a href=\"https://pypi.org/project/pymemri/\"><img src=\"https://pepy.tech/badge/pymemri\" /></a>\n\nPlugins connect and add the information to your Pod. Plugins that <b>import your data from external services</b> are called **Importers** (Gmail, WhatsApp, etc.). Plugins that <b>connect new data to the existing data</b> are called **indexers** (face recognition, spam detection, object detection, etc.). Lastly there are plugins that <b>execute actions</b> (sending messages, uploading files).\n\n## Installing\n\n### As a package\n```bash\npip install pymemri\n```\n\n### Development\nTo install the Python package for development, run:\n```bash\npip install -e .\n```\n\n## Contributing\nIf you would like to contribute to Pymemri, have a look at our [contibuting guidelines](CONTRIBUTING.md) to get started and join our Discord if you have any questions about using or contributing to the library.\n## Quickstart: Pod Client\n\nAll 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](https://gitlab.memri.io/memri/pod), and run `./examples/run_development.sh`.\n\nIf you have a running pod, you can define and add your own item definitions:\n\n```python\nfrom pymemri.data.schema import Item\nfrom pymemri.pod.client import PodClient\n\nclass Dog(Item):\n name: Optional[str] = None\n age: Optional[int] = None\n\n# Connect to the pod and add the Dog item definition\nclient = PodClient()\nclient.add_to_schema(Dog)\n\n# Add a Dog to the pod\ndog = Dog(name=\"Rita\", age=3)\nclient.create(dog)\n```\n\n## Quickstart: Running a plugin\n\nAfter installation, users can use the plugin CLI to manually run a plugin. For more information on how to build a plugin, see `run_plugin`.\n\n<b>With the pod running, run in your terminal: </b>\n\n```bash\nstore_keys\nrun_plugin --metadata \"example_plugin.json\"\n```\n\nThis 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.`\n\n## Docs\n\n[pymemri docs](https://docs.memri.io/component-architectures/plugins/readme/)\n",
"bugtrack_url": null,
"license": "MPPL License",
"summary": "A python client for the memri Pod, and tools to create Plugins",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://gitlab.memri.io/memri/pymemri"
},
"split_keywords": [
"memri",
"privacy",
"personal",
"data",
"client",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c86ffaff7a32bf40e05e4b49b2083fedf01e5b6b9ba1d133194b99df2269262a",
"md5": "de48ae4a43f0f6e0907a4e2886ae625e",
"sha256": "a2ccfb9bba6aa47076cea892fc697a0910afea8496ecdfb25a47dff7dfcbd976"
},
"downloads": -1,
"filename": "pymemri-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "de48ae4a43f0f6e0907a4e2886ae625e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 76351,
"upload_time": "2023-11-17T10:18:02",
"upload_time_iso_8601": "2023-11-17T10:18:02.897909Z",
"url": "https://files.pythonhosted.org/packages/c8/6f/faff7a32bf40e05e4b49b2083fedf01e5b6b9ba1d133194b99df2269262a/pymemri-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aea7aba434acd4ddd00ece0f5dd3744e7abc243846c3ef137b73a4d9e2ea869d",
"md5": "d08c63263b677c57f7d6f03f6107a825",
"sha256": "68310303d98feae6602cebcf56ac328a035b3d571a8ccea4fa735f2f57e4845f"
},
"downloads": -1,
"filename": "pymemri-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "d08c63263b677c57f7d6f03f6107a825",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 66014,
"upload_time": "2023-11-17T10:18:05",
"upload_time_iso_8601": "2023-11-17T10:18:05.771182Z",
"url": "https://files.pythonhosted.org/packages/ae/a7/aba434acd4ddd00ece0f5dd3744e7abc243846c3ef137b73a4d9e2ea869d/pymemri-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-17 10:18:05",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pymemri"
}