Skip to main content

EntityDataCSV

EntityDataCSV​

EntityDataCSV(filename: str, **kwargs)

Bases: CSVParser

ApertureDB Entity Data.

This class loads the Entity Data which is present in a CSV file, and converts it into a series of ApertureDB queries.

Note

Is backed by a CSV file with the following columns:

EntityClass, PROP_NAME_1, ... PROP_NAME_N, constraint_PROP1

Example CSV file::

EntityClass,name,lastname,age,id,constraint_id
Person,John,Salchi,69,321423532,321423532
Person,Johna,Salchi,63,42342522,42342522
...

Example usage:


data = EntityDataCSV("/path/to/EntityData.csv")
loader = ParallelLoader(client)
loader.ingest(data)

Info

In the above example, the constraint_id ensures that a Entity with the specified id would be only inserted if it does not already exist in the database.

EntityDeleteDataCSV​

EntityDeleteDataCSV(entity_class, filename, df=None, use_dask=False)

Bases: CSVParser

ApertureDB Entity Delete Data.

This class loads the Entity Data which is present in a CSV file, and converts it into a series of ApertureDB deletes.

!!! note Expects a CSV file with the following columns:

     ``constraint_PROP1``

Example CSV file::

 constraint_id
321423532
42342522
...

Example usage:

```python

 data = ImageDeleteDataCSV("/path/to/UnusedImages.csv")
loader = ParallelQuery(client)
loader.query(data)

```

!!! info In the above example, the constraint_id ensures that a Entity with the specified id would be only deleted.

 Note that you can take a csv with normal prop data and this will ignore it, so you
could use input to a loader to this.

ImageDeleteDataCSV​

ImageDeleteDataCSV(filename, df=None, use_dask=False)

Bases: EntityDeleteDataCSV

ApertureData CSV Loader class for deleting images

Usage details in EntityDeleteDataCSV