Skip to main content

tareco

Graphs made simple. Hand it a CSV, a DataFrame or a list of pairs and get a beautiful interactive graph you can drag, search and click through. Then ask it real questions: who matters most, who bridges groups, which communities exist, what is the shortest route.

No dependencies. Every algorithm is written from scratch in pure Python, and the view is a single self-contained HTML file that works offline.

tareco interactive view

pip install tareco

One line

import tareco

tareco.show("friends.csv")

That's it. Columns named from/to, source/target, origem/destino (and friends) are found on their own, otherwise the first two columns are used. Every other column becomes an edge attribute. Nodes are colored by community and sized by importance automatically.

It also takes whatever you already have:

tareco.show([("ana", "bia"), ("bia", "caio", 3.5)])          # pairs, optional weight
tareco.show({"ana": ["bia", "caio"], "bia": ["davi"]})       # dict of neighbors
tareco.show(df)                                              # pandas DataFrame
tareco.show("friends.csv", nodes="people.csv")               # node attributes too
tareco.show(df, source="sender", target="receiver", directed=True)

From the terminal:

tareco friends.csv --nodes people.csv --color city

The view

  • Hover a node to light up its neighborhood; click it for a side panel with its metrics, attributes and clickable neighbors.
  • Drag nodes around; dragged nodes stay pinned (right-click to release).
  • Search with /, jump with Enter.
  • Shortest path mode: click two nodes and the route lights up.
  • Legend filters: click a group to hide it, double-click to see only it.
  • Freeze the layout, toggle labels, switch dark/light, save a PNG.
  • Directed graphs get arrows; particles=True animates the flow.
  • dim=3 gives you a 3D graph you can orbit.
g.show(
    color="city",            # attribute or metric: "community", "pagerank", "degree",
                             # "betweenness", "closeness", "clustering", "core", "component"
    size="betweenness",      # same options, numbers only
    label="name",            # attribute to display instead of the id
    edge_width="messages",   # defaults to "weight" when edges have one
    title="Friends",
    theme="dark",            # "auto", "dark", "light"
)
g.save("friends.html")       # standalone file, send it to anyone

color and size also accept a {node: value} dict (like the output of any algorithm), a function of the node, or a fixed CSS color. In Jupyter, VS Code and Colab the view shows up inline; just leave a graph as the last line of a cell.

The graph

g = tareco.Graph("friends.csv", nodes="people.csv")

g.add_edge("Ana", "Zeca", weight=2, since=2019)
g.add_node("Zeca", city="Recife")

g.nodes["Ana"]              # {'city': 'Recife', 'age': 31}
g.edges["Ana", "Bia"]       # {'messages': 42}
g.neighbors("Ana")          # ['Bia', 'Caio', 'Duda', 'Pedro', 'Zeca']
g.degree("Ana")             # 5
len(g), g.edge_count        # (17, 32)

g.subgraph(["Ana", "Bia", "Caio"])
g.ego("Ana", radius=2)       # everyone within two steps
g.reverse(), g.to_undirected(), g.copy()

The questions

Ask Method
Overview g.summary()
Shortest route g.shortest_path(a, b, weight=None), g.distance(a, b), g.distances(a)
Who is important g.pagerank(), g.degree_centrality()
Who bridges groups g.betweenness()
Who is close to everyone g.closeness()
Which groups exist g.communities() (Louvain), g.modularity(groups)
Are they connected g.components(), g.strong_components(), g.is_connected()
How tight is it g.clustering(), g.triangles(), g.transitivity(), g.density()
The core g.core_number(), g.k_core(k)
Who should meet g.suggest_links(node=None, top=10) (Adamic-Adar)
Cheapest wiring g.spanning_tree(weight="weight")
Order of tasks g.topological_sort(), g.has_cycle()
Size of the world g.diameter()
Walk it g.bfs(a), g.dfs(a)

Results are plain dicts, lists and sets. Pass weight="some_attribute" to use edge weights. The algorithms are tested against networkx and give the same numbers.

Ready-made graphs

tareco.community_graph([30, 20, 10])   # planted groups, great for testing communities()
tareco.scale_free_graph(500, 2)        # a few big hubs, like the web
tareco.small_world_graph(100, 4, 0.1)  # ring with shortcuts
tareco.random_graph(100, 0.05)
tareco.grid_graph(10, 10), tareco.complete_graph(8), tareco.star_graph(6)
tareco.path_graph(5), tareco.cycle_graph(5)

In and out

g.to_csv("edges.csv", "nodes.csv")    tareco.read_csv("edges.csv", "nodes.csv")
g.to_json("graph.json")               tareco.read_json("graph.json")
nodes_df, edges_df = g.to_pandas()    tareco.Graph(df, nodes=nodes_df)
g.to_networkx()                       tareco.Graph(nx_graph)

CSV files may use , ; \t or |, and 1,5-style decimals are understood.

Development

pip install -e ".[test]"
pytest

The interactive view is drawn with force-graph (MIT), bundled inside the package so pages work offline. The 3D view loads 3d-force-graph from a CDN.

Metadata

Release files for tareco 1.0.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 tareco 1.0.0
File Size Uploaded Provenance Actions
tareco-1.0.0.tar.gz 101.3 kB With provenance Details for tareco-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tareco 1.0.0
File Interpreter ABI Platform Actions
tareco-1.0.0-py3-none-any.whl Python 3 none any Details for tareco-1.0.0-py3-none-any.whl

Total release size: 198.3 kB

Release files / tareco-1.0.0.tar.gz

Download URL tareco-1.0.0.tar.gz
Size 101.3 kB
Tags Source
SHA-256 checksum
How to use checksums
32dcfdc6b9b3573c0fa61b4d29f1f37c58209e1cb7dd92e49cdd8cd9965d7530
BLAKE2b-256 checksum
How to use checksums
0c67b83ac5753efb82e3b5e148642b1e93ab513216976e2e5bed1d05eff746f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / tareco-1.0.0-py3-none-any.whl

Download URL tareco-1.0.0-py3-none-any.whl
Size 97.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5b1e89f38fd83bc3edc57325b5c39a3d6236f8d76fa69e6f2cbf593e957ca79
BLAKE2b-256 checksum
How to use checksums
fd8ba5ae9314553e6d36143a2833a0c3d553ddf75125a7f0d109587c91cda613
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for tareco 1.0.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tareco-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

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