Skip to main content

Galaxy graph

Edit and manage graph.

Getting started

Requirements

  • Python >= 3.14

Installation

To install this package in the current python environment, use: python -m pip install galaxy_graph

Usage

from galaxy_graph import Graph, Node, Connection

graph = Graph()
house = Node("house")
graph.add(house)
house.connect(Connection(data="has room"), Node("bedroom"))
house.connect(Connection(data="has room"), Node("kitchen"))
house.connect(Connection(data="has room"), Node("bathroom"))

bedroom = graph.get_by_id("bedroom")
bedroom.connect(Connection(data="has area"), Node(data=9))
kitchen = graph.get_by_id("kitchen")
kitchen.connect(Connection(data="has area"), Node(data=7))
bathroom = graph.get_by_id("bathroom")
bathroom.connect(Connection(data="has area"), Node(data=6))

house.connect(
    Connection(data="has adress"),
    Node(data="1 Grande Rue, 0000, Saint Roustan"),
)

rooms = {
    node
    for node in house.get_neighbors_by_connection_data(
        predicate=lambda data: data == "has room",
    )
}
total_area = sum({
    sum({
        area.data
        for area in room.get_neighbors_by_connection_data(
            predicate=lambda data: data == "has area"
        )
    })
    for room in rooms
})
number = len(rooms)

print(f"this house has {number} rooms with a total area of {total_area} m^2")

Documentation

A complete documentation is available in the wiki.

Development

Requirements

This project use mise to manage development tools.

[!TIP] If mise is installed, and mise.toml is trusted with mise trust, all tools can be installed automatically with `mise install``

This project use the following tools:

  • just: command runner
  • hatch: project manager and package builder
  • uv: package installer
  • ruff: python linter and formatter
  • ty: python type checker
  • jujutsu: version control

[!NOTE] Tools used in the project consume and produce interoperable format to avoid vendor lock-in. This is the toolchain of the current maintener.

Usage

just can be used to speed up development for an identical toolchain.

Before making a commit, just fix will run all tests, format the code, lint and type check. If you don’t want to modify the code, just check will run all tests, lint and type check without any attempt to fix any issue.

Before a version change, just release will push all local commits to repository and publish the new package version.

All available commands can be listed with just -l.

License

This project is licensed under the GNU GPL v3+. See license file for more information.

Acknowledgement

Thanks to all the people that worked on the tools used, like python, neovim and mise.

Metadata

Release files for galaxy_graph 1.1.3

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

Source distribution (sdist)

Source distribution for galaxy_graph 1.1.3
File Size Uploaded
galaxy_graph-1.1.3.tar.gz 33.2 kB Details

Built distribution (wheel)

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

Total release size: 89.3 kB

Release files / galaxy_graph-1.1.3.tar.gz

Download URL galaxy_graph-1.1.3.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
478a8d5d8326b5ff0435c5a8c349cc552a3cbcdc0f455cda186e3c6171fd70fa
BLAKE2b-256 checksum
How to use checksums
57f92b9c4babe7eae74b4e71b3d340e58ab8fe90d9a3c1f8aa7ddbd33a8d29f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.14.6 HTTPX/0.28.1

Release files / galaxy_graph-1.1.3-py3-none-any.whl

Download URL galaxy_graph-1.1.3-py3-none-any.whl
Size 56.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06569af4ab6f9f98d30a0cddc50e00a9b12e471d1d3f975cef8bd450eab13ff8
BLAKE2b-256 checksum
How to use checksums
aa8dfd83ab9090f941b551eba4d43d95328e418daf86e6c1d476c1ae4ca410d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.14.6 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.1

2 release files

1.0.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.1

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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