G2Engine Cleanup

Cleanup

purgeRepository

purgeRepository() purges the G2 repository of all data except configuration data.

Warning

WARNING: purgeRepository() DELETES all entity, record, and feature data from the Senzing repository.

#! /usr/bin/env python3

from senzing import G2Engine, G2Exception
import json

# REPLACE /home/user/your_project with the path to your Senzing project
senzing_engine_configuration_json = '{ "PIPELINE": { "CONFIGPATH": "/home/user/your_project/etc", "SUPPORTPATH": "/home/user/your_project/data", "RESOURCEPATH": "/home/user/your_project/resources" }, "SQL": { "CONNECTION": "sqlite3://na:na@/home/user/your_project/var/sqlite/G2C.db" } }'

g2_engine = G2Engine()

try:
    g2_engine.init("G2Engine", senzing_engine_configuration_json)

    g2_engine.purgeRepository()

    g2_engine.destroy()

except G2Exception as err:
    print(err)