Skip to main content

Python SDK and CLI tool for the IDSecure API

Project description

IDSecure Python SDK & CLI

A Python client and CLI tool for interacting with the IDSecure API. This project provides a simple and intuitive interface to manage users, devices, and view logs within your IDSecure instance.

Installation

Install via pip:

pip install idsecure-cli

Or install from source:

git clone https://github.com/tsuriu/idsecure-cli.git
cd idsecure-cli
pip install .

CLI Usage

The package includes a command-line interface idsecure-cli.

Configuration

You can provide credentials via flags or environment variables:

  • --url / IDSECURE_BASE_URL
  • --user / IDSECURE_USERNAME
  • --password / IDSECURE_PASSWORD

Commands

# List all users
idsecure-cli list-users

# List all devices
idsecure-cli list-devices

# Get details for a specific user
idsecure-cli get-user --id 123

# Delete a user
idsecure-cli delete-user --id 123

Visitor Management

# List all visitors
idsecure-cli list-visitors

# Create a new visitor
idsecure-cli create-visitor --name "John Doe" --date "01/01/2026"

# Delete a visitor
idsecure-cli delete-visitor --id 456

Group & Department Management

# List all groups
idsecure-cli list-groups

# List all departments
idsecure-cli list-departments

# Create a new group
idsecure-cli create-group --name "Engineering" --user-id 123 --user-id 456

# Create a new department
idsecure-cli create-department --name "R&D"

# Update a group
idsecure-cli update-group --id 789 --name "Hardware Engineering"

# Delete a group
idsecure-cli delete-group --id 789

SSL Verification

If you are using a local instance with a self-signed certificate, you can disable SSL verification using the --no-verify flag:

idsecure-cli --no-verify list-users

SDK Usage

You can also use the IDSecureClient directly in your Python scripts.

Initialization

import asyncio
from idsecure_cli import IDSecureClient

async def main():
    # Initialize the client
    client = IDSecureClient(
        base_url="https://your-idsecure-instance.com", 
        username="your-username", 
        password="your-password"
    )

    # All client methods are asynchronous
    async with client:
        users = await client.list_users()
        print(f"Total users: {users.get('recordsTotal')}")

if __name__ == "__main__":
    asyncio.run(main())

SSL Verification (SDK)

To disable SSL verification in the SDK:

client = IDSecureClient(..., verify=False)

Examples

Check the examples/ directory for more usage examples:

  • example_usage.py: Demonstrates listing users, devices, logs, and departments.

To run the example script with self-signed certificates:

IDSECURE_VERIFY=false python3 examples/example_usage.py

Requirements

  • Python 3.8+
  • httpx
  • click
  • loguru

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

idsecure_cli-0.1.5.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

idsecure_cli-0.1.5-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file idsecure_cli-0.1.5.tar.gz.

File metadata

  • Download URL: idsecure_cli-0.1.5.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for idsecure_cli-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b10e8ad7eeab00e27067b149684a5e81f95589b724a3d38ad8041a21fddcb977
MD5 096d7e2508b5caebeedb4a01216b69da
BLAKE2b-256 d697a652e94168e82f0f5cc969d778beeba7ad7a8ac215523541744027d16e4f

See more details on using hashes here.

File details

Details for the file idsecure_cli-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: idsecure_cli-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for idsecure_cli-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 29c1c0c11a18ef0e032c88c522153ffd74d488d834a8cfc0fe9afdb1857806c8
MD5 95a8901f1b30168fe0d0448ecd49f086
BLAKE2b-256 66b2fd32132ec5f8bc84a9cb00504559d7a02b56145acf85759b5f2594946d97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page