{"id":19287777,"url":"https://github.com/deeppavlov/dialog_flow_db_connector","last_synced_at":"2026-02-13T15:03:01.614Z","repository":{"id":62591342,"uuid":"486189739","full_name":"deeppavlov/dialog_flow_db_connector","owner":"deeppavlov","description":"Dialog Flow DB Connector is an addon for the Dialog Flow Framework and allows you to to save and retrieve user dialogue states (in the form of a `Context` object) using various database backends. ","archived":false,"fork":false,"pushed_at":"2022-08-24T21:19:00.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"dev","last_synced_at":"2024-11-05T06:05:15.225Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deeppavlov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-27T12:48:49.000Z","updated_at":"2023-05-03T10:33:55.000Z","dependencies_parsed_at":"2022-11-03T22:52:14.388Z","dependency_job_id":null,"html_url":"https://github.com/deeppavlov/dialog_flow_db_connector","commit_stats":null,"previous_names":["deepmipt/dialog_flow_db_connector"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeppavlov%2Fdialog_flow_db_connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeppavlov%2Fdialog_flow_db_connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeppavlov%2Fdialog_flow_db_connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeppavlov%2Fdialog_flow_db_connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deeppavlov","download_url":"https://codeload.github.com/deeppavlov/dialog_flow_db_connector/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223888420,"owners_count":17220083,"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":[],"created_at":"2024-11-09T22:07:11.497Z","updated_at":"2026-02-13T15:03:01.485Z","avatar_url":"https://github.com/deeppavlov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Dialog Flow DB Connector\n\n[There](https://github.com/deepmipt/dialog_flow_db_connector) is an addon for the [Dialog Flow Framework](https://github.com/deepmipt/dialog_flow_engine), a minimalistic open-source engine for conversational services.\n\n[Dialog Flow DB Connector](https://github.com/deepmipt/dialog_flow_db_connector) allows you to to save and retrieve user dialogue states (in the form of a `Context` object) using various database backends. \n\nCurrently, the supported options are: \n* [json](https://www.json.org/json-en.html)\n* [pickle](https://docs.python.org/3/library/pickle.html)\n* [shelve](https://docs.python.org/3/library/shelve.html)\n* [Sqlite](https://www.sqlite.org/index.html)\n* [Postgresql](https://www.postgresql.org/)\n* [MySQL](https://www.mysql.com/)\n* [MongoDB](https://www.mongodb.com/)\n* [Redis](https://redis.io/)\n* [YDB](https://ydb.tech/)\n\nAside from this, we offer some interfaces for saving data to your local file system. These are not meant to be used in production, but can be helpful for prototyping your application.\n\n\u003c!-- [![Documentation Status](https://df-db-connector.readthedocs.io/en/stable/?badge=stable)](https://readthedocs.org/projects/df-db-connector/badge/?version=stable) --\u003e\n\u003c!-- [![Coverage Status](https://coveralls.io/repos/github/deepmipt/dialog_flow_db_connector/badge.svg?branch=main)](https://coveralls.io/github/deepmipt/dialog_flow_db_connector?branch=main) --\u003e\n[![Codestyle](https://github.com/deepmipt/dialog_flow_db_connector/workflows/codestyle/badge.svg)](https://github.com/deepmipt/dialog_flow_db_connector)\n[![Tests](https://github.com/deepmipt/dialog_flow_db_connector/workflows/test_coverage/badge.svg)](https://github.com/deepmipt/dialog_flow_db_connector)\n[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/deepmipt/dialog_flow_db_connector/blob/main/LICENSE)\n![Python 3.6, 3.7, 3.8, 3.9](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-green.svg)\n\u003c!-- [![PyPI](https://img.shields.io/pypi/v/df-db-connector)](https://pypi.org/project/df-db-connector/)\n[![Downloads](https://pepy.tech/badge/df-db-connector)](https://pepy.tech/project/df-db-connector) --\u003e\n\n# Quick Start\n## Installation\n```bash\npip install df-db-connector\n```\n\nPlease, note that if you are going to use one of the database backends, you will have to specify an extra or install the corresponding requirements yourself.\n```bash\npip install df-db-connector[redis]\npip install df-db-connector[mongodb]\npip install df-db-connector[mysql]\npip install df-db-connector[postgresql]\npip install df-db-connector[sqlite]\npip install df-db-connector[ydb]\n```\n\n## Basic example\n```python\nfrom df_engine.core import Context, Actor\nfrom df_db_connector import SQLConnector\nfrom .script import some_df_script\n\ndb = SQLConnector(\"postgresql://user:password@host:port/dbname\")\n\nactor = Actor(some_df_script, start_label=(\"root\", \"start\"), fallback_label=(\"root\", \"fallback\"))\n\n\ndef handle_request(request):\n    user_id = request.args[\"user_id\"]\n    if user_id not in db:\n        context = Context(id=user_id)\n    else:\n        context = db[user_id]\n    new_context = actor(context)\n    db[user_id] = new_context\n    assert user_id in db\n    return new_context.last_response\n\n```\n\nTo get more advanced examples, take a look at [examples](https://github.com/deepmipt/dialog_flow_db_connector/tree/main/examples) on GitHub.\n\n# Contributing to the Dialog Flow DB Connector\n\nPlease refer to [CONTRIBUTING.md](https://github.com/deepmipt/dialog_flow_db_connector/blob/main/CONTRIBUTING.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeppavlov%2Fdialog_flow_db_connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeppavlov%2Fdialog_flow_db_connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeppavlov%2Fdialog_flow_db_connector/lists"}