Skip to main content

My HyGraph Package

Description

This package provides tools for managing and analyzing HyGraph data.

Installation

To install the package, use the following command: pip install hygraph-core

Usage

from hygraph_core import HyGraph, HyGraphQuery
      # Initialize HyGraph
    hygraph = HyGraph()

    # Sample data for nodes and edges
    # Creating nodes
    node1 = hygraph.add_pgnode(oid=1, label="Node1", start_time=pd.to_datetime("2023-01-01"))
    node2 = hygraph.add_pgnode(oid=2, label="Node2", start_time=pd.to_datetime("2023-01-01"))

    # Adding static properties to nodes
    node1.add_static_property("description", "This is node 1", hygraph)
    node2.add_static_property("description", "This is node 2", hygraph)

    # Create an edge with static and dynamic properties
    edge = hygraph.add_pgedge(
        oid=10,
        source=node1.getId(),
        target=node2.getId(),
        label="Edge1",
        start_time=pd.to_datetime("2023-01-01"),
        properties={"weight": 5}
    )
    # Define timestamps and values
    timestamps = pd.to_datetime(["2023-01-01", "2023-01-02", "2023-01-03"])
    values = [[1], [3], [5]]

    # Create the time series
    metadata = TimeSeriesMetadata(owner_id=edge.getId(), element_type='edge')  # or whatever the correct metadata is
    time_series = TimeSeries(tsid='traffic_series', timestamps=timestamps, variables=['traffic'], data=values,
                             metadata=metadata)
    # Add a dynamic property to the edge (if supported in your implementation)
    edge.add_temporal_property("traffic", time_series, hygraph)

    # Query example: retrieve all edges between `Node1` and `Node2`
    query = HyGraphQuery(hygraph) \
        .match_node(alias='node1', node_id=node1.getId()) \
        .match_edge(alias='edge') \
        .match_node(alias='node2', node_id=node2.getId()) \
        .connect('node1', 'edge', 'node2') \
        .return_(edge=lambda result: result['edge'])

    # Execute query and print results
    edges = query.execute()
    print("Edges between Node1 and Node2:", edges)

    # Display nodes, edges, and properties
    print("Nodes and their properties:")
    for node_id, data in hygraph.graph.nodes(data=True):
        print(f"Node ID: {node_id}, Data: {data}")

    print("\nEdges and their properties:")
    for u, v, data in hygraph.graph.edges(data=True):
        print(f"Edge from {u} to {v}, Data: {data}")

# Example usage here

Metadata

Release files for hygraph-core 0.3.9.9

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

Source distribution (sdist)

Source distribution for hygraph-core 0.3.9.9
File Size Uploaded Provenance
hygraph_core-0.3.9.9.tar.gz 71.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hygraph-core 0.3.9.9
File Interpreter ABI Platform
hygraph_core-0.3.9.9-py3-none-any.whl Python 3 none any Details

Total release size: 152.2 kB

Release files / hygraph_core-0.3.9.9.tar.gz

Download URL hygraph_core-0.3.9.9.tar.gz
Size 71.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ed939e092e761de1e40cdffc9816d4fa8dd9ef47b25840444c16c8ef5a461785
BLAKE2b-256 checksum
How to use checksums
cfc8e68cb4e29254208cd641c520bac954b02c617d9b2c40925abea7a9f7db88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Release files / hygraph_core-0.3.9.9-py3-none-any.whl

Download URL hygraph_core-0.3.9.9-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c82909de7b044ba165d0330536401e63bed49b2a9f92ba72461095006fc1eea9
BLAKE2b-256 checksum
How to use checksums
333032522c9d13217612d3f1342c0e9c794067dc9a7c487bdbc5bd8cb4803585
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Security for hygraph-core 0.3.9.9

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.

Release history Release notifications | RSS feed

This release

0.3.9.9 This release

2 release files No provenance

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