diff --git a/.circleci/config.yml b/.circleci/config.yml index b0553de..6ecba65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,11 +39,12 @@ jobs: command: python setup.py sdist - run: - name: run tests + name: run tests and upload coverage command: | . venv/bin/activate - pip install git+https://github.com/RedisGraph/redisgraph-py.git@master - python -m unittest test/test_bulk_loader.py + pip install -r test/requirements.txt + pytest --cov redisgraph_bulk_loader + codecov -t ${CODECOV_TOKEN} workflows: version: 2 diff --git a/.gitignore b/.gitignore index fd917c1..53f735b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +.coverage + # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml diff --git a/README.md b/README.md index 1539e0d..26e8c80 100644 --- a/README.md +++ b/README.md @@ -17,52 +17,65 @@ A Redis server with the [RedisGraph](https://github.com/RedisLabsModules/RedisGr https://oss.redislabs.com/redisgraph/ ## Installation -The bulk loader script's dependencies can be resolved using pip: +The bulk loader can be installed using pip: ``` pip install git+https://github.com/RedisGraph/redisgraph-bulk-loader.git@master ``` ## Usage +Pip installation exposes `redisgraph-bulk-insert` as a command to invoke this tool: +``` redisgraph-bulk-insert GRAPHNAME [OPTIONS] +``` + +Installation by cloning the repository allows the script to be invoked via Python like so: +``` +python3 redisgraph_bulk_loader/bulk_insert.py GRAPHNAME [OPTIONS] +``` -| Flags | Extended flags | Parameter | -|---------|-----------------------|-----------------------------------------------------------------| -| -h | --host TEXT | Redis server host (default: 127.0.0.1) | -| -p | --port INTEGER | Redis server port (default: 6379) | -| -a | --password TEXT | Redis server password | -| -n | --nodes TEXT | path to node csv file [required] | -| -r | --relations TEXT | path to relationship csv file | -| -t | --max-token-count INT | max number of tokens sent in each Redis query (default 1024) | -| -b | --max-buffer-size INT | max batch size (MBs) of each Redis query (default 4096) | -| -c | --max-token-size INT | max size (MBs) of each token sent to Redis (default 500) | -| -q | --quote | the quoting format used in the CSV file. QUOTE_MINIMAL=0,QUOTE_ALL=1,QUOTE_NONNUMERIC=2,QUOTE_NONE=3 | -| -f | --field-types | json to set explicit types for each field, format {