Skip to main content

A Python library for managing verifiable credentials with WalliD CertiShop.

Project description

Overview

The WalliD CertiShop lib provides an interface for interacting with the WalliD API. It allows users to create Certificate Authorities, manage templates, issue verifiable certificates, and verify certificates through a simplified and structured approach.

Features

  • Create and manage Certificate Authorities (CAs)
  • Create and manage templates
  • Issue verifiable credentials
  • Verify credentials
  • Error handling for API requests

Installation

To use the WalliD library, run the following code in your terminal

pip install wallid-certishop

Usage

Initialize the WalliD Client

from certishop import WalliD

api_url = "https://demo.eidcmp.wallid.io/api/v1"
api_token = "your_api_token"

wallid = WalliD(api_url, api_token)

Create a Certificate Authority

wallet_address = "0xYourWalletAddress"
admin_email = "admin@example.com"
response = wallid.create_ca(wallet_address, admin_email)
print(response)

Create a Template

cid = "cid_value"
name = "template_name"
wa = "0xYourWalletAddress"
frontend_props = {
    "components": [
        {"id": "component_id", "type": "text"}
    ],
    "currentLayout": "current_layout"
}
response = wallid.create_template(cid, name, wa, frontend_props)
print(response)

Issue a Certificate

cid = "cid_value"
tid = "tid_value"
waAdmin = "0xYourWalletAddress"
data = [{"key": "value"}]
email = "user@example.com"
response = wallid.issue_credential(cid, tid, waAdmin, data, email)
print(response)

Verify a Certificate

credential_id = "credential_id"
tid = "tid_value"
guid = "guid_value"
response = wallid.verify_credential(credential_id, tid, guid)
print(response)

Error Handling

The library includes error handling to manage API response errors gracefully. When an error occurs, it raises an exception with a descriptive error message.

Tests

The library includes a suite of unit tests to verify functionality. You can run the tests using:

python -m unittest discover

Contributing

Contributions are welcome! If you would like to contribute to the WalliD library, please create a pull request or open an issue for discussion.

License

Instructions

  1. Update Links and Tokens: Make sure to replace any placeholder text (like your-repository-name, your_api_token, etc.) with actual values relevant to your project.
  2. Add any additional sections: You may want to include additional sections, such as "Known Issues," "Future Improvements," or "FAQ," depending on your project's complexity.

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

wallid-certishop-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

wallid_certishop-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file wallid-certishop-0.1.1.tar.gz.

File metadata

  • Download URL: wallid-certishop-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for wallid-certishop-0.1.1.tar.gz
Algorithm Hash digest
SHA256 054c320575e9117a7e53b1993eeb4fc3a2b4afc9e1b6f2d06a255bfb4cac9d59
MD5 2830ee73d543b9386ba5741512c7ada8
BLAKE2b-256 820938dbb64bca9c77fed73fec6e3008d853d90da22f46338aa290595bf4b7b5

See more details on using hashes here.

File details

Details for the file wallid_certishop-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for wallid_certishop-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a2b6f398c68f3365adcc2419ef2df3d1dd9d542d5f49c575ee0ed7c02195c93
MD5 d1bd5fbc8b61524ea7230f18bf59e266
BLAKE2b-256 288d0a3abf654b1a0434d180b0ada7a35c86a2d02539741283892503a4b2d7c8

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