Skip to content

Commit

Permalink
Move additional documentation to docs directory (#71)
Browse files Browse the repository at this point in the history
To keep the README as clear and focused as possible.
  • Loading branch information
istride authored Dec 7, 2023
1 parent 5e15afe commit 1f23a42
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 45 deletions.
56 changes: 11 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ParentText Pipeline

Handles the process for producing RapidPro flows from data held in Google Sheets.
Handles the process for producing RapidPro flows from data held in spreadsheets.

# Setup

Expand All @@ -17,51 +17,17 @@ To start the pipeline:
python -m parenttext_pipeline.cli
```

You will need to create a file called 'config.py', in the current working directory, and define a callable called 'create_config' that returns the pipeline settings as a dict. More details can be in the [configuration page].
You will need to create a file called 'config.py', in the current working directory, and define a callable called 'create_config' that returns the pipeline settings as a dict. More details can be in the [configuration page][config].

# RapidPro flow importer
# Documentation

A user account on a RapidPro server is required.
- [Configuration][config] - details of configuration options for the pipeline
- [RapidPro flow importer] - to automatically import flow definitions into RapidPro
- [Archive tool] - to create snapshots of source Google Sheets to support repeatable pipeline runs
- [Transcode tool] - to prepare video and audio files that may be used by ParentText applications

## CLI

```
rpimport --help
```

## Python import

```
from parenttext_pipeline.importer import import_definition
import_definition(
host,
username,
password,
definition_file,
)
```

# Archive tool

Used to create snapshots of source Google Sheets to support repeatable pipeline runs. See [archive tool docs] for details.


# Transcode

ParentText chatbots need supporting media files. This project contains a script that will transcode source video files to video and audio files that meet the ParentText specification.

## Requirements

The script uses the [FFmpeg] command, so it will need to be installed before the script can be used.

## CLI

```
python -m parenttext.transcode --help
```


[configuration page]: docs/configuration.md
[archive tool docs]: docs/archive.md
[FFmpeg]: https://ffmpeg.org/
[config]: docs/configuration.md
[Archive tool]: docs/archive.md
[RapidPro flow importer]: docs/rapidpro-import.md
[Transcode tool]: docs/transcode.md
40 changes: 40 additions & 0 deletions docs/rapidpro-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Requirements

- URL of a RapidPro host
- Account credentials (username, password) for a user with the 'Editor' role in a RapidPro workspace
- One or more flow definition (JSON) files to upload

# Run

## CLI

The command itself provides information on usage:

```
rpimport --help
```

For example:

```
rpimport --host https://example.com --user example --password pass flow_definition_1.json flow_definition_2.json
```

## Python import

From within your own Python script/application:

```
from parenttext_pipeline.importer import import_definition
import_definition(
"https://example.com",
"example",
"pass",
["definition_file_1.json", "definition_file_2.json"],
)
```

# CI/CD

When running within continuous integration/deployment software, it is recommended that the password be kept secret at all times. The importer tool will not print any log messages containing the password.
17 changes: 17 additions & 0 deletions docs/transcode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Overview

ParentText chatbots need supporting media files. This project contains a script that will transcode source video files to video and audio files that meet the ParentText specification.

## Requirements

- Install the [FFmpeg] command
- Obtain source video files

## CLI

```
python -m parenttext.transcode --help
```


[FFmpeg]: https://ffmpeg.org/

0 comments on commit 1f23a42

Please sign in to comment.