> For the complete documentation index, see [llms.txt](https://gitbook.bergelsonlab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.bergelsonlab.com/archive/old-osf-pages/scripts-and-the-like/basicleveltidy.md).

# basicleveltidy

This script helps with making changes to audio and video file annotations.

## basicleveltidy

This script helps with making changes to audio and video file annotations.

If you need to make changes to entries in the basic level files, those changes need to ripple back to the original annotated cha and opf files.

This script acts on aggregated basic\_level csv files. You make the annotation changes to these long/concatenated csv's, then pass that file to the basicleveltidy script. It will crawl through the Subject\_Files directory tree and find all the files that need to be updated. This includes the original basic\_level file, cha files, and opf files.

Github repo [here](https://github.com/SeedlingsBabylab/basicleveltidy)

### usage

#### create\_edit\_csv.py

The concatenated csv doesn't have the edit columns in it yet. It's in this form:

| id                                  | tier  | object    | utterance\_type | object\_present | speaker | timestamp        | basic\_level |
| ----------------------------------- | ----- | --------- | --------------- | --------------- | ------- | ---------------- | ------------ |
| 01\_10\_coderAR\_audio\_checkSM.csv | \*MAN | alligator | d               | n               | FAT     | 4989390\_4990400 | alligator    |

The csv that needs to be fed into basicleveltidy needs to have extra columns where you put your edits. By running the create\_edits\_csv.py script, it will create a new csv based on the original concatenated one with those extra columns.

extra columns:

| object\_edit | utt\_type\_edit | obj\_present\_edit | speaker\_edit | basic\_level\_edit |
| ------------ | --------------- | ------------------ | ------------- | ------------------ |
| s            |                 |                    | gator         |                    |

```
$: python create_edits_csv.py [original_aggregate_basic_level.csv
```

#### [blt.py](http://blt.py/)

This is the main script that does the Subject\_Files directory traversal and file updates. After you've made edits to the csv file that was output by create\_edits\_csv.py, you need to pass it to the [blt.py](http://blt.py/) (basicleveltidy) script:

```
$: python blt.py [output_from_create_edits_csv.csv]
```

If the csv you pass in is for video files, you might get this message after running [blt.py](http://blt.py/):

```
================================================
#                                              #
#  A file: "opf_diffs.csv" has been created.   #
#  This file needs to be passed through a      #
#  datavyu script to update the opf files.     #
#                                              #
================================================
```

This opf\_diffs.csv file needs to be fed into a Datavyu script (blt\_opf\_update.rb). You run the datavyu script like any other, except you need to specify the path to the opf\_diffs.csv file within the script itself. [For example](https://github.com/SeedlingsBabylab/datavyu_scripts/blob/master/blt_opf_update.rb#L12)
