Skip to main content

This is a Python library for building IVMS data structure.

Project description

Sygna Bridge IVMS Util For Python

Installation

pip install sygna-bridge-ivms-util

Example

from sygna_bridge_ivms_util import ivms
import json

# Originator
# originator name id
org_name_id = ivms.NaturalPersonNameId()
org_name_id.primary_identifier = "Wu"
org_name_id.secondary_identifier = "Xinli"
org_name_id.name_identifier_type = ivms.NaturalPersonNameTypeCode.LEGL

# another name id for originator
org_name_local_id = ivms.LocalNaturalPersonNameId()
org_name_local_id.primary_identifier = "吳"
org_name_local_id.secondary_identifier = "信利"
org_name_local_id.name_identifier_type = ivms.NaturalPersonNameTypeCode.LEGL

# assign two name id to originator name
org_person_name = ivms.NaturalPersonName()
org_person_name.name_identifiers = [org_name_id]
org_person_name.local_name_identifiers = [org_name_local_id]

# originator national id and data
org_person_national_id = ivms.NationalIdentification()
org_person_national_id.national_identifier = "446005"
org_person_national_id.national_identifier_type = ivms.NationalIdentifierTypeCode.RAID
org_person_national_id.registration_authority = "RA000553"

# assign name, national id, country to originator natural person
org_nature_person = ivms.NaturalPerson()
org_nature_person.name = org_person_name
org_nature_person.national_identification = org_person_national_id
org_nature_person.country_of_residence = "TZ"

# assign originator to person object
org_persion = ivms.Person()
org_persion.natural_person = org_nature_person

# assign originator person and account id to originator
originator = ivms.Originator()
originator.originator_persons = [org_persion]
originator.account_numbers = ["1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"]

# Beneficiary
# beneficiary 1 name id
bene_1_name_id = ivms.LegalPersonNameId()
bene_1_name_id.legal_person_name = "ABC Limited"
bene_1_name_id.legal_person_name_identifier_type = ivms.LegalPersonNameTypeCode.LEGL

# assign beneficiary 1 name with id
bene_1_person_name = ivms.LegalPersonName()
bene_1_person_name.name_identifiers = [bene_1_name_id]

# beneficiary 1 is a legal person
bene_1_legal_person = ivms.LegalPerson()
bene_1_legal_person.name = bene_1_person_name

# assign beneficiary 1 to person object
bene_1_person = ivms.Person()
bene_1_person.legal_person = bene_1_legal_person

# beneficiary 2 name id
bene_2_name_id = ivms.LegalPersonNameId()
bene_2_name_id.legal_person_name = "CBA Trading"
bene_2_name_id.legal_person_name_identifier_type = ivms.LegalPersonNameTypeCode.TRAD

# assign beneficiary 2 name with id
bene_2_person_name = ivms.LegalPersonName()
bene_2_person_name.name_identifiers = [bene_2_name_id]

# beneficiary 2 is a legal person
bene_2_legal_person = ivms.LegalPerson()
bene_2_legal_person.name = bene_2_person_name

# assign beneficiary 2 to person object
bene_2_person = ivms.Person()
bene_2_person.legal_person = bene_2_legal_person

# assign both persons to beneficiary object
beneficiary = ivms.Beneficiary()
beneficiary.beneficiary_persons = [bene_1_person, bene_2_person]

# assign originator and beneficiary data to identity payload
private_info = ivms.IdentityPayload()
private_info.originator = originator
private_info.beneficiary = beneficiary

# pretty print json
print(json.dumps(private_info.to_dict(), indent=2, ensure_ascii=False))

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

sygna_bridge_ivms_util-0.0.7.tar.gz (15.1 kB view details)

Uploaded Source

File details

Details for the file sygna_bridge_ivms_util-0.0.7.tar.gz.

File metadata

  • Download URL: sygna_bridge_ivms_util-0.0.7.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for sygna_bridge_ivms_util-0.0.7.tar.gz
Algorithm Hash digest
SHA256 aa6eaec43d7795329832ea0457eaf0f081dc3140d8c4eafc3417b03b21c07f83
MD5 6cd3baa6bdca3bab882eb510ada1294f
BLAKE2b-256 1569c608de2325d8b21ab7d4833b895958a25ca65ddc0191bb9da4154720540b

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