Skip to main content

Links Client - Python Implementation

Python client library for link-cli — implementation of Links Theory database.

Installation

Prerequisites

Install link-cli globally:

dotnet tool install --global clink

Package Installation

pip install -e .

Or install from the repository root:

cd python
pip install -e .

Usage

Basic Usage

from links_client import LinkDBService

db = LinkDBService('/path/to/database.links')

# Create a link
link = db.create_link(100, 200)
print(link)  # {'id': 1, 'source': 100, 'target': 200}

# Read all links
links = db.read_all_links()

# Delete a link
db.delete_link(1)

Menu Storage

from links_client import MenuStorageService

menu_storage = MenuStorageService()

menu = [
    {
        "label": "Dashboard",
        "icon": "pi pi-home",
        "to": "/dashboard",
        "items": [
            {"label": "Analytics", "to": "/dashboard/analytics"}
        ]
    }
]

menu_storage.store_menu_structure(menu, 0)
retrieved_menu = menu_storage.get_menu_structure(0)

Authentication Storage

from links_client import AuthStorageService

auth_storage = AuthStorageService()

# Create user
user = auth_storage.create_user({
    "username": "alice",
    "email": "alice@example.com"
})

# Set password
auth_storage.set_password(user['userId'], {
    "hash": "hashed_password",
    "salt": "random_salt"
})

API

For detailed API documentation, see the docs/ directory.

Examples

See examples in the examples/ directory:

  • basic_usage.py - Basic clink integration tests
  • menu_storage_example.py - Menu storage demonstration
  • auth_storage_example.py - Authentication storage demonstration

Testing

Run tests with pytest:

pytest tests/

License

The Unlicense

Metadata

Release files for links-client 1.0.0

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

Source distribution (sdist)

Source distribution for links-client 1.0.0
File Size Uploaded Provenance Actions
links_client-1.0.0.tar.gz 16.6 kB Without provenance Details for links_client-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for links-client 1.0.0
File Interpreter ABI Platform Actions
links_client-1.0.0-py3-none-any.whl Python 3 none any Details for links_client-1.0.0-py3-none-any.whl

Total release size: 29.1 kB

Security for links-client 1.0.0

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

1.0.0 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