An application that parses unstructured text and constructs a Knowledge Graph with a rich web of inter-connected relationships using FalkorDB.
In essence, this tool snacks stuff and outputs a knowledge graph of what it snacked on.
This is purely for exploration purposes.
Install uv (see the doc site), our Python package manager of choice. Here is a quick start guide of uv that contains some basic features.
Verify your setup by running the command below.
uv run python src/main.py --helpTip: Whenever this command is run, uv automatically installs the needed packages from the lockfile into your .venv project environment and even creates it if hasn't been yet (see the doc site about 'project environment' for more info).
The project includes a CLI for processing text files. Show all available commands using help.
uv run python src/main.py --helpA successful run should look like:
Usage: main.py [OPTIONS] COMMAND [ARGS]...
Snack2Graph parses unstructured text and constructs a Knowledge Graph with a rich web of inter-connected relationships using FalkorDB.
╭─ Options ───────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────╮
│ construct Create a knowledge graph with the given text file. │
│ version Show the current version of the CLI tool. │
╰─────────────────────────────────────────────────────────────────╯ruff is the chosen linter & formatter for this project.
Check for lint violations for all files in the project with the configured lint rules:
uv run ruff checkUpdate all files in the project with the configured formatting rules:
uv run ruff formatYou can also install extensions in your own IDE that support ruff to help you run these linting & formatting check as your develop. The recommended plugin for this project is Ruff by Astral Software, and here is a sample JSON you can use in settings.json to lint & format code and organize imports automatically.
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
}