Skip to main content

cqhyxk SDK

Python SDK for the 身份中台V2.0 OpenAPI (Identity Management Platform V2.0 OpenAPI)

License: MIT Python Version

Overview

This SDK provides a Python interface to interact with the Identity Management Platform V2.0 API, allowing you to manage personnel, organizations, tags, and event subscriptions programmatically.

The SDK provides:

  • Type Safety: All requests and responses are validated with Pydantic models
  • Environment Configuration: Load credentials from environment variables
  • Complete API Coverage: All endpoints from the OpenAPI specification
  • Error Handling: Comprehensive error handling with custom exceptions
  • Documentation: Detailed documentation for all methods

Installation

Install the package using pip:

pip install cqhyxk

Or using uv:

uv pip install cqhyxk

Quick Start

  1. Set up environment variables by creating a .env file (see .env.example):

    CQHYXK_BASEURL=https://your-domain/backend/school-platform/openapi
    CQHYXK_APP_KEY=your_app_key_here
    CQHYXK_APP_SECRET=your_app_secret_here
    
  2. Initialize the client and make API calls:

    from cqhyxk import CqhyxkClient
    from cqhyxk.models import IdentityPageRequest
    
    # Initialize the client (credentials loaded from environment variables)
    client = CqhyxkClient()
    
    # Example: Get first 10 identities
    request = IdentityPageRequest(current=0, size=10)
    response = client.get_identity_list(request)
    
    print(f"Retrieved {len(response.data.content)} identities")
    for identity in response.data.content:
        print(f"- {identity.name} ({identity.sourceUserId})")
    

Configuration

The SDK supports configuration via environment variables:

  • CQHYXK_BASEURL: The base URL for the API (default: https://your-domain/backend/school-platform/openapi)
  • CQHYXK_APP_KEY: Your application key for API authentication
  • CQHYXK_APP_SECRET: Your application secret for API authentication

You can also pass these values directly to the constructor:

client = CqhyxkClient(
    app_key="your_app_key",
    app_secret="your_app_secret", 
    base_url="https://your-api-domain.com"
)

Available Methods

Personnel Methods

  • get_identity_list(request): Get paginated list of personnel identity information
  • get_face_photos(source_user_id): Get face photos by student ID

Organization Methods

  • get_org_list(physical, internal, org_id): Get list of organizations

Tag Methods

  • get_tag_list(tag_id): Get list of tags
  • get_member_tags_page(request): Get paginated list of personnel tag relationships

Event Subscription Methods

  • add_subscription(request): Subscribe to events
  • cancel_subscription(event_type): Cancel event subscription

For detailed documentation of each method, including parameters and response formats, check the docstrings in the source code.

Examples

Run the example script to see the SDK in action:

python example.py

Make sure your environment variables are properly configured before running the example.

Development

To install the package in development mode:

git clone https://github.com/liudonghua123/cqhyxk.git
cd cqhyxk
pip install -e .

Or with uv:

uv pip install -e .

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes (git commit -m 'Add some amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues, please file a bug report in the GitHub repository or contact the maintainers.

API Documentation

For detailed API documentation, refer to the original OpenAPI specification.

Metadata

Release files for cqhyxk 0.0.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 cqhyxk 0.0.1
File Size Uploaded Provenance
cqhyxk-0.0.1.tar.gz 14.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 28.9 kB

Release files / cqhyxk-0.0.1.tar.gz

Download URL cqhyxk-0.0.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
34a681e77bc7b7491ed1a2f722bd9e1a0a039a780b3a4e6f777f8d76f0936423
BLAKE2b-256 checksum
How to use checksums
7f4a9ec035f29454b6823491de46b556115a8fc0741cc2bc47a9b8984d01a3bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cqhyxk-0.0.1-py3-none-any.whl

Download URL cqhyxk-0.0.1-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5b758ace6432debcd61fe6d9bf671001b21df1f0abf531109e31c4dde77ff82
BLAKE2b-256 checksum
How to use checksums
a910767aafd92f0408182caeb3f35b27e43b89b7edc75af5644629cf46adc915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cqhyxk 0.0.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.

Release history Release notifications | RSS feed

This release

0.0.1 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