Skip to main content

traverse-http

Python client for the HTTP API of a Traverse server: queries in openCypher or GQL, database and file management, aliases, schema, CSV and Cypher import, and users. Python 3.10+, one dependency (requests).

To run Traverse inside your own process instead, use traverse-embedded.

Installation

pip install traverse-http

Quick start

The server prints its API key at startup (API key tvs_...), or takes one from TRAVERSE_API_KEY.

from traverse_http import TraverseHttpClient

client = TraverseHttpClient("http://localhost:7691", api_key="tvs_your_key")

client.query("CREATE (:Person {name: 'Alice', age: 34}), (:Person {name: 'Bob', age: 28})")

result = client.query(
    "MATCH (p:Person) WHERE p.age > $age RETURN p.name AS name ORDER BY name",
    parameters={"age": 30},
)
print(result.columns, result.rows)  # ['name'] [['Alice']]

# ISO/IEC 39075 GQL instead of openCypher
result = client.query("MATCH (p:Person) FILTER p.age > 30 RETURN p.name AS name", dialect="gql")

for db in client.list_databases():
    print(db.name, db.aliases)

schema = client.get_schema()
print(schema.labels, schema.relationship_types)

Each call takes an optional database= to target a database other than the default one.

Databases, files and aliases

client.create_database("staging")
client.rename_database("staging", "registry")
client.drop_database("registry")  # unless the server runs with TRAVERSE_ALLOW_DROP_DATABASE=false

# upload a .tvdb file built offline (for example with traverse-embedded), load it and point an
# alias at it; queries against the alias move to the new data in one step
with open("registry_v2.tvdb", "rb") as f:
    client.upload_file("registry_v2", f.read())
client.load_database("registry_v2", "registry_v2.tvdb")
client.create_alias("registry", "registry_v2")  # later: client.alter_alias("registry", "registry_v3")

CSV import

from traverse_http import ColumnMapping, EdgeEndpoint

people = "id,name,age\n1,Alice,34\n2,Bob,28\n"
result = client.import_csv(
    people,
    "Person",
    [ColumnMapping("id", type="integer"), ColumnMapping("name"), ColumnMapping("age", type="integer")],
)
print(result.nodes_created)  # 2

knows = "from,to,since\n1,2,2019\n"
result = client.import_csv_edges(
    knows,
    "KNOWS",
    source=EdgeEndpoint(label="Person", column="from", property="id"),
    target=EdgeEndpoint(label="Person", column="to", property="id"),
    columns=[ColumnMapping("since", type="integer")],
)
print(result.edges_created)  # 1

Column types are string (the default), integer, float and boolean; property= stores a column under another name.

Errors

A failed request raises TraverseHttpException, with the HTTP status in status_code.

License

Copyright 2026 The Intelligence Company AB (publ). Licensed under MIT or Apache-2.0, at your option.

Metadata

Release files for traverse-http 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traverse-http 0.9.0
File Size Uploaded Provenance Actions
traverse_http-0.9.0.tar.gz 15.1 kB Without provenance Details for traverse_http-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traverse-http 0.9.0
File Interpreter ABI Platform Actions
traverse_http-0.9.0-py3-none-any.whl Python 3 none any Details for traverse_http-0.9.0-py3-none-any.whl

Total release size: 28.8 kB

Release files / traverse_http-0.9.0.tar.gz

Download URL traverse_http-0.9.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b723f0c4689e24ce2cc897873050d138f701936d7565994b6934050ae4fabd72
BLAKE2b-256 checksum
How to use checksums
10092f99c838e8a82ee9e523e7ea5b5b5706fdff0726a6cad2598b920324251a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / traverse_http-0.9.0-py3-none-any.whl

Download URL traverse_http-0.9.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a26bac3800ae94f80cfaf7a65b9fc87ec1f1635ccb44969db5f5b6387a6ab0e8
BLAKE2b-256 checksum
How to use checksums
6b7123c75c5f61ac9d38d2b181a72d872aad7f9e7fe1b54c3b23bc4d0b6af223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for traverse-http 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page