GraphistryClient#
Build and visualize graphs, starting from various formats or database connections.
Register with our server to upload graphs for visualization.
GraphistryClient Class#
Build graphs and authenticate for remote visualization.
- Example:
import graphistry # Register to the singleton GraphistryClient graphistry.register(...) # Create a :py:class:`graphistry.plotter.Plotter` g = graphistry.bind(nodes=df_nodes, edges=df_edges) g.plot()
Session Management: The GraphistryClient manages authentication and state through a ClientSession object. On plot(), the ArrowUploader manages user auth token refresh on that ClientSession.
Concurrency: Methods are the concurrency boundary. The global PyGraphistry instance uses shared session state, so it’s not safe for concurrent use across threads. For concurrent or multi-tenant scenarios, create separate client instances using graphistry.client().
- Multiple clients:
import graphistry # Create independent client instances alice_g = graphistry.client() alice_g.register(api=3, username='alice', password='pw') bob_g = graphistry.client() bob_g.register(api=3, username='bob', password='pw')
Each client has its own isolated session (self.session) that tracks: - Authentication tokens and refresh state - Server configuration (hostname, protocol, API version) - Organization and privacy settings - SSO and personal key authentication state
See:graphistry.plotter.Plotter
, for session management in plottables.
ClientSession Class#
Holds all configuration and authentication state for a Graphistry client.
Session Isolation: Each GraphistryClient instance maintains its own ClientSession, providing isolation for concurrent and multi-tenant use cases. The session tracks:
Authentication state (tokens, API keys, SSO state)
Server configuration (hostname, protocol, API version)
Organization and privacy settings
Plugin configurations (Kusto, Spanner, etc.)
Thread Safety: A ClientSession instance should only be used within a single concurrency context (thread, async task, etc.). For multi-threaded applications, create separate client instances for each thread.
Token Management: Authentication tokens may be refreshed during plot() operations. The session maintains the current token state and handles refresh automatically.