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._state.online.get_neighbors_by_connection_data(
        filter_=lambda data: data == "has room",
    )
}
total_area = sum({
    sum({
        area.data
        for area in room._state.online.get_neighbors_by_connection_data(
            filter_=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.

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

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 0.2.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 galaxy_graph 0.2.1
File Size Uploaded Provenance Actions
galaxy_graph-0.2.1.tar.gz 11.6 kB Without provenance Details for galaxy_graph-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 38.9 kB

Release files / galaxy_graph-0.2.1.tar.gz

Download URL galaxy_graph-0.2.1.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a92bbd3403fff111693e2ad8b9a3128e489193abcfabd156edd3e1b977ba70ca
BLAKE2b-256 checksum
How to use checksums
70a3273b3da31d424dd4b30291bc9cf6ffee4be6d43303bfe0c2fda2c88e86a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.14.5 HTTPX/0.28.1

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

Download URL galaxy_graph-0.2.1-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61b585c6f6a9b2c738d056b6e9d93a4c1139e5a3664bfd536604473029c503aa
BLAKE2b-256 checksum
How to use checksums
e7f4a03fbcd15a8ec09e7f3a8f968838678db36e511ffd18ba370491f60a7896
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.14.5 HTTPX/0.28.1

Security for galaxy_graph 0.2.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