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.1

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.1
File Size Uploaded Provenance Actions
traverse_http-0.9.1.tar.gz 15.1 kB Without provenance Details for traverse_http-0.9.1.tar.gz

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / traverse_http-0.9.1.tar.gz

Download URL traverse_http-0.9.1.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7fffdaa8818a4569f7035ce4c2833e322e476b03ee3403d6eb872e08f24b923
BLAKE2b-256 checksum
How to use checksums
82e67984d07db21fbcad9030e3649621e8769da0af33d4de30272032d7d4bd50
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.1-py3-none-any.whl

Download URL traverse_http-0.9.1-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b51abf13473e56c35c3f4fde8b62ea7b2684d8944f278cceaf10626507399821
BLAKE2b-256 checksum
How to use checksums
f33dc0d4d8f9583179f67b7dd94dbaad191b17ecaed37946196098bbc8e251cf
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.1

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