Skip to main content

PyPI Code Coverage Python versions License Conventional Commits

FLAME Hub Python Client

The FLAME Hub Python Client is a client which wraps the endpoints of FLAME Hub API. This repository is part of the PrivateAIM project.

Getting started

To install the client, Python 3.10 or higher is required.

python -m pip install flame-hub-client

Quickstart

The FLAME Hub Python Client offers get, find, update, create and delete methods for the core, storage and auth endpoints. It is capable of authenticating against the API using either password or client authentication. Pick one, provide your credentials and plug them into the class for the service you want to use. Note that the client will automatically reauthenticate if necessary.

import flame_hub

auth = flame_hub.auth.PasswordAuth(
    username="admin", password="start123", base_url="http://localhost:3000/auth/"
)
auth_client = flame_hub.AuthClient(base_url="http://localhost:3000/auth/", auth=auth)

Now you're ready to use the library's functions! Start off with getting the so-called master realm by using one of the find methods and filtering for the name "master".

master_realms = auth_client.find_realms(filter={"name": "master"})

Every find method returns a list of matching resources. Since there is only one realm called "master" in this example, we simply pop it from the list and print the result.

assert len(master_realms) == 1
master_realm = master_realms.pop()

print(master_realm.model_dump_json(indent=2))
{
  "name": "master",
  "displayName": null,
  "description": null,
  "id": "794f2375-f043-4789-bd0c-e5534e8deeaa",
  "builtIn": true,
  "createdAt": "2025-05-12T09:44:08.284000Z",
  "updatedAt": "2025-05-12T09:44:08.284000Z"
}

Next we want to create a new node. Node resources are accessible over endpoints under the core directive. So the first step is to create a new core client and then create a new node.

core_client = flame_hub.CoreClient(base_url="http://localhost:3000/core/", auth=auth)
my_node = core_client.create_node(name="my-node", realm_id=master_realm)

print(my_node.model_dump_json(indent=2))
{
  "externalName": null,
  "hidden": false,
  "name": "my-node",
  "realmId": "794f2375-f043-4789-bd0c-e5534e8deeaa",
  "registryId": null,
  "type": "default",
  "id": "03636152-e6a8-4e01-994e-18b2b0c3a935",
  "publicKey": null,
  "online": false,
  "registry": null,
  "registryProjectId": null,
  "registryProject": null,
  "robotId": null,
  "clientId": "2d3e19b4-6708-4279-b2a7-34ad42638e4b",
  "createdAt": "2025-05-19T15:43:57.859000Z",
  "updatedAt": "2025-05-19T15:43:57.859000Z"
}

Maybe making the node public wasn't such a good idea, so let's update it by hiding it. To see if the update was successful, we have to request the updated node from the Hub.

core_client.update_node(my_node, hidden=True)

assert core_client.get_node(my_node.id) is True

To clean up our mess, we delete the node and verify that the node is gone forever.

core_client.delete_node(my_node)

assert core_client.get_node(my_node.id) is None

Note that not all method types are implemented for each resource. Check out the documentation to see which methods are available.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flame_hub_client-0.5.2.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flame_hub_client-0.5.2-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file flame_hub_client-0.5.2.tar.gz.

File metadata

  • Download URL: flame_hub_client-0.5.2.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for flame_hub_client-0.5.2.tar.gz
Algorithm Hash digest
SHA256 120cfe358c15ee1b3ac7f541cbbc2f66edd2868119f661900d5d0419e1bad51b
MD5 8d8b79deae483950ba22035d25fff399
BLAKE2b-256 4135d14a5b8a6726b24b8fd0c91fa5fd49d1470529f07241950be46ec8d15b0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for flame_hub_client-0.5.2.tar.gz:

Publisher: release.yml on PrivateAIM/hub-python-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flame_hub_client-0.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flame_hub_client-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9a99c1a30a12bbb3f916f5f38701afc6e52977a7fb53cb3d570b8e401e64857
MD5 2662f7439ed2da14081fdc51e749f898
BLAKE2b-256 3b8680c299c0dfe6630a88ba98c3612785f0194cfb68741fd6c93312a341d854

See more details on using hashes here.

Provenance

The following attestation bundles were made for flame_hub_client-0.5.2-py3-none-any.whl:

Publisher: release.yml on PrivateAIM/hub-python-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

This release

0.5.2 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.16

2 files

0.2.15

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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