Skip to main content

Sertipy

Python library for the Sertiva Web API

Instalation

pip install sertipy

or upgrade

pip install sertipy --upgrade

Quick Start

To get started, install sertipy and create an account on Sertiva. Add your client ID and client SECRET to your environment:

User authentication

# import library or package sertipy
from sertipy.client import Sertiva

# make obj client sertiva
sertiva = Sertiva(client_id='<your_client_id>', client_secret='<your_client_secret>')

Feature

Sertipy supports all of the features of the Sertiva Web API including access to all end points, and support for user authorization. For details on the capabilities check Sertiva Web API

Designs

# to get list designs
sertiva.designs.list()

# to get detail design
sertiva.designs.detail('<design_id>')

Templates

# to get list templates
sertiva.templates.list()

# to get detail template
sertiva.templates.detail('<template_id>')

# create new template
sertiva.templates.create('<design_id>', '<title>', '<description>')

# update template
sertiva.templates.update('<template_id>', '<title>', '<description>')

Recipients

# to get list draft recipients
sertiva.recipients.list('<template_id>')

# create new draft recipient
data_create = [
    {
        "name": "John Doe",
        "email": "john@doe.com",
        "fields": {
            "credentialSubject": {
                "activityDate": "2021-05-01T19:23:24.000000"
            }
        }
    },
]

sertiva.recipients.create('<template_id>', data_create)

# update draft recipient
data_update = [
    {
        "id": "72150eae-b469-4fbf-9b02-226075a9cf10",
        "phone": "0898989898989",
        "fields": {
            "credentialSubject": {
                "credentialNumber": "ID/1/1000"
            }
        }
    },
]

sertiva.recipients.update('<template_id>', data_update)

# delete recipient
data_delete = ['72150eae-b469-4fbf-9b02-226075a9cf10']

sertiva.recipients.delete('<template_id>', data_delete)

Credentials

# get list all credentials
sertiva.credentials.list()

# get detail some credential
sertiva.credentials.detail('<credential_id>')

Main

Issue using data recipients in draft

# with all data in draft
sertiva.mains.issue('<template_id>', '<issuance_date>', '<expiration_date>')

# with recipient ids
recipient_ids = ['6ad5c6e0-9ac7-488b-b05f-d8b32b73b4cf']

sertiva.mains.issue('<template_id>', '<issuance_date>', '<expiration_date>', recipient_ids)

Issue Using data recipients directly (without make draft recipient)

recipients = [{
    "id": "72150eae-b469-4fbf-9b02-226075a9cf10",
    "name": "John Doe",
    "email": "john@doe.com",
    "fields": {
        "credentialSubject": {
            "credentialNumber": "ID/1/1000",
            "activityDate": "2021-05-01T19:23:24.000000"
        }
    }
},]
sertiva.mains.issue('<template_id>', '<issuance_date>', '<expiration_date>', recipients)
  • for data id you can make with uuid

Verify and Revoke

# verify credential
data_to_verify = ['72150eae-b469-4fbf-9b02-226075a9cf10']

sertiva.mains.verify(data_to_verify)

# revoke credential
data_to_revoke = ['72150eae-b469-4fbf-9b02-226075a9cf10']
reason = 'wrong certificate'

sertiva.mains.revoke(data_to_revoke, reason)

Reporting Issues

If you have suggestions, bugs or other issues specific to this library, file them here. Or just send a pull request

Metadata

Release files for sertipy 1.1.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 sertipy 1.1.0
File Size Uploaded
sertipy-1.1.0.tar.gz 5.7 kB Details

Built distribution (wheel)

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

Total release size: 12.5 kB

Release files / sertipy-1.1.0.tar.gz

Download URL sertipy-1.1.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5d49c439a618a9be7781531f4408707896ff74ae1f16de6f52ad24e69bf0bf66
BLAKE2b-256 checksum
How to use checksums
2b2f89614e59ac5ce9a0151348477f6bdf5051b9b4ac24ed36edc3ca0fd5b96d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

Release files / sertipy-1.1.0-py3-none-any.whl

Download URL sertipy-1.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff993373dd16e3cf9078b450349b219cb1c47bb3e7045fa817971d8c81afa696
BLAKE2b-256 checksum
How to use checksums
c95a4a33efbb309f1f9541c03b56e07e1cdd3a0353669a9ac044d33aafa9b119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release 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