Repository navigation
CLI for interacting with aperturedb - #249
Conversation
Features: Ingestion mount serve docs observe
* Ingest command. * Some cleanup and utils.
Co-authored-by: luisremis <[email protected]>
|
|
||
|
|
||
| @app.command() | ||
| def from_json_file(filepath: str): |
There was a problem hiding this comment.
For the use case of creating indexes that I mentioned, we can just put the query on a .json file and use this. Neat.
I am still unsure what should go on Python scripts and what to move to bash. I think we will learn over time, but if you have an idea, a Readme with your practices to learn from would be good.
| from aperturedb.Configuration import Configuration | ||
|
|
||
|
|
||
| class ObjEncoder(JSONEncoder): |
There was a problem hiding this comment.
Would be nice to have a explanation of this.
There was a problem hiding this comment.
I will put the comment.
| from aperturedb.cli.console import console | ||
| console.log(db) |
There was a problem hiding this comment.
it would be nicer to have the import at top, is there a reason it is here?
There was a problem hiding this comment.
no will adjust that.
|
|
||
| multiplier = multiplier // 2 | ||
| path = "input/images/" | ||
| path = "images/" |
There was a problem hiding this comment.
I liked having a separate "input" directory where the csv was and the the images were below, as were blobs.
There was a problem hiding this comment.
It's still going to end up there. The problem was that the path was relative to the cwd of the running code. With adb, you can run it from arbitrary folder, adjusting the CLI path.
This change mostly sets the image path relative to the csv path, and the DataCSV treats it as such.
There was a problem hiding this comment.
BTW, this should be applicable to anything having blobs. I will update the Video and Blobs too.
luisremis
left a comment
There was a problem hiding this comment.
lgtm! I think we should addressed this before merging, but it is ok to create an Issue on it and fix it in a subsequent PR if it will be addressed soon. it is scary to be 1 tab away from deleting data.
This provides a few of commonly repeated scripts
Additionally, not being based on getopt, it has features like bash auto completion, and richer console io.
The most important bit that it provides would be to not have configuration put in as code, use connections across projects (if required).