Skip to main content

**Dialog Flow Script Parser** is python module add-on for [Dialog Flow Framework](https://github.com/deeppavlovteam/dialog_flow_framework), a free and open-source software stack for creating chatbots, released under the terms of Apache License 2.0.

Project description

Dialog Flow Script Parser

Dialog Flow Script Parser is python module add-on for Dialog Flow Framework, a free and open-source software stack for creating chatbots, released under the terms of Apache License 2.0.

Dialog Flow Script Parser allows you to parse python files in order to extract inputs and dictionaries. Codestyle Tests License Apache 2.0 Python 3.6, 3.7, 3.8, 3.9

Quick Start

Installation

pip install df_script_parser

py2yaml

df_script_parser.py2yaml --help
usage: df_script_parser.py2yaml [-h] [--requirements REQUIREMENTS] ROOT_FILE PROJECT_ROOT_DIR OUTPUT_FILE

Compress a dff project into a yaml file by parsing files inside PROJECT_ROOT_DIR starting with ROOT_FILE.
Extract imports, assignments of dictionaries and function calls from each file.
Recursively parse imported local modules.
Collect non-local modules as project requirements

positional arguments:
ROOT_FILE             Python file to start parsing with
PROJECT_ROOT_DIR      Directory that contains all the local files required to run ROOT_FILE
OUTPUT_FILE           Yaml file to store parser output in

optional arguments:
-h, --help            show this help message and exit
--requirements REQUIREMENTS
File with project requirements to override those collected by parser

NOTE: Use py2yaml parser in the same python environment that is used to launch the script otherwise site packages will not be found. NOTE: Any assignments of function calls in which the function being called is df_engine.core.Actor will be checked for correctness of the arguments passed to the function.

File formats

The OUTPUT_FILE will contain:

  1. requirements key which points to a list of project requirements collected by parser. If optional argument REQUIREMENTS was specified replace the list with a list of requirements from that file
  2. namespaces key which points to a dictionary with all the parsed files. Keys are the names of those modules that could be used to import it from PROJECT_ROOT_DIR or its parent directory if PROJECT_ROOT_DIR contains a __init__.py file. The values are dictionaries in which keys are the names of the objects inside the module while values are their definitions.

yaml2py

df_script_parser.yaml2py --help
usage: df_script_parser.yaml2py [-h] YAML_FILE EXTRACT_TO_DIRECTORY

Extract project from a yaml file to a directory

positional arguments:
YAML_FILE             Yaml file to load
EXTRACT_TO_DIRECTORY  Path to the directory to extract project to

optional arguments:
-h, --help            show this help message and exit

Examples

To get more advanced examples, take a look at examples.

Contributing to the Dialog Flow Script Parser

Please refer to CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

df_script_parser-0.2.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

df_script_parser-0.2.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file df_script_parser-0.2.0.tar.gz.

File metadata

  • Download URL: df_script_parser-0.2.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for df_script_parser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e3342dd0fa42bebaa191d6a37290d7f6df0f319e7a0de5b71e836ac5492d4237
MD5 530fe20ef58e412c9fd26315b1fe3304
BLAKE2b-256 9e822d93d8528ad8333b4b2247d66b4bc451d184e827b9690b8d1708041e6ac1

See more details on using hashes here.

File details

Details for the file df_script_parser-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for df_script_parser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38f3311adb91672805ec6e56450489d7afccd1edda28b1ab56aafdbb23286b7a
MD5 b23a20ca503795da495ac9f426daf8a5
BLAKE2b-256 33451164d929254b3ae0e6421900e03776d2fef8b2f4ed9aa7c535c4b02cc522

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page