Skip to main content

grandlite

A SQLite-like tool for querying graphs from the command-line using graph query languages in in-memory Python.

Supports out-of-core graphs with Grand.

Installation

$ pip install grandlite

Usage

Get stats about a graph

$ uv run grandlite --stats 'h-edgelist(pre:post)://white_1986_n2u.csv'
Nodes: 221
Edges: 1855
Density: 0.038153023447141096
Orphans: 0
Leaves: 7
Max degree: 44
Max node: RIMR
Self-loops: 52

Run an interactive Cypher session

$ grandlite my-graph.graphml
> match (a)-[]->(b) return a,b limit 3

        a       b
0  023620  364605
1  023620  438847
2  023620  462336

> save results.json

> exit()

Note that save [filename] will output csv, json, and jsonl files, depending on the extension provided; or will default to results-XXXX.json with XXX as a timestamp in ISO format, if no filename is provided.

For more information about saving, see the docs.

Command-line options

$ grandlite --help
usage: An interactive graph query tool for Cypher and other query languages.
       [-h]
       [-o {csv,json,jsonl}]
       [-q QUERY]
       [-l {cypher,dotmotif}]
       [--stats]
       [--convert OUTPUT_FILENAME]
       graph

positional arguments:
  graph                 The filename of the graph to load.

options:
  -h, --help            show this help message and exit
  -o {csv,json,jsonl}, --output {csv,json,jsonl}
                        The output format to use.
  -q QUERY, --query QUERY
                        If not provided, enters an interactive prompt.
  -l {cypher,dotmotif}, --language {cypher,dotmotif}
                        The query language to use (default: cypher).
  --stats               Print statistics about the graph and exit.
  --convert OUTPUT_FILENAME
                        Convert the graph to a new format, save to the
                        output filename specified, and exit.

Input formats

Grandlite supports a growing variety of input formats. For a complete list, see the docs.

Examples

OpenCypher

$ grandlite 'vertex:vertices.csv;edge:edges.csv'

CSV / Edgelist with or without headers

$ grandlite 'h-edgelist(pre:post)://white_1986_n2u.csv'

Made with 💙 at JHU APL


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grandlite-0.2.0.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grandlite-0.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file grandlite-0.2.0.tar.gz.

File metadata

  • Download URL: grandlite-0.2.0.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for grandlite-0.2.0.tar.gz
Algorithm Hash digest
SHA256 65409d4309b1566aa37023f983f716b3c80e6dd2daf6a2631c44232cd4874024
MD5 8d4e19f1c913e1c8d2982123227041f5
BLAKE2b-256 02d345f853ca49db0f07a1f53da4a9858755fae66428f0d1cff862edede3d993

See more details on using hashes here.

File details

Details for the file grandlite-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: grandlite-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for grandlite-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 667df11c2000e4d3e77f1d095d5366608a8ce4845b83f595d1ab95f374e10de3
MD5 be48f91feb1a2923d2c91f3574ad216e
BLAKE2b-256 0297e1a176864ef6f63f5f10b5257328191d314434483ec51bf4cc1e2c4aba74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page