Circular Documentation
  • Getting Started
  • Introduction
    • Introducing Circular
  • Circular's Mission
  • Circular's Technology
    • Certificates & Data Anchoring
    • Multi-Chain Architecture
    • Certified Nodes & Jurisdictional Deployment
    • HyperCode & GPU Accelerated Processing
    • Proof of Reputation Consensus Mechanism
  • Certified Intelligence
  • Developer Tools
    • Enterprise APIs
      • Javascript
        • CEP_Account.open()
        • CEP_Account.setNetwork()
        • CEP_Account.setBlockchain()
        • CEP_Account.update()
        • CEP_Account.submitCertificate()
        • CEP_Account.getTransactionOutcome()
        • CEP_Account.getTransaction()
        • CEP_Account.close()
      • Node.JS
        • CEP_Account.open()
        • CEP_Account.setNetwork()
        • CEP_Account.setBlockchain()
        • CEP_Account.update()
        • CEP_Account.submitCertificate()
        • CEP_Account.getTransactionOutcome()
        • CEP_Account.getTransaction()
        • CEP_Account.close()
      • PHP
        • CEP_Account.open()
        • CEP_Account.setNetwork()
        • CEP_Account.setBlockchain()
        • CEP_Account.updateAccount()
        • CEP_Account.submitCertificate()
        • CEP_Account.getTransactionOutcome()
        • CEP_Account.getTransaction()
        • CEP_Account.close()
      • Python
        • CEP_Account.open()
        • CEP_Account.set_network()
        • CEP_Account.set_blockchain()
        • CEP_Account.update_account()
        • CEP_Account.submit_certificate()
        • CEP_Account.get_transaction_outcome()
        • CEP_Account.get_transaction()
        • CEP_Account.close()
      • Java
        • CEP_Account.open()
        • CEP_Account.setNetwork()
        • CEP_Account.setBlockchain()
        • CEP_Account.updateAccount()
        • CEP_Account.submitCertificate()
        • CEP_Account.getTransactionOutcome()
        • CEP_Account.getTransaction()
        • CEP_Account.close()
  • SDK
  • CLI & Tooling
  • Core Concepts
    • Overview
    • Certificates
  • Accounts
  • Private Chains
  • Data Management
  • Fees
  • Nodes
  • Private Keys
  • Recovery Phrases
  • Tutorials & Examples
    • Circular Connect Guide
      • Create an Organisation Account
      • Create a Blockchain Account
      • Purchase Certificates
      • Using the Explorer & Viewing Certificate Details
    • Create Your First Certificate
  • Industry Use Cases
    • Industry Use Cases - Overview
    • Clinical Trials
    • Medical Devices
    • Public Health
    • Pharma Supply Chains
    • Research and Academia
Powered by GitBook
On this page
  • Overview
  • Installation
  • Usage example
  • Useful Links
  1. Developer Tools
  2. Enterprise APIs

Python

Overview

The Circular Enterprise APIs provide a powerful and efficient way to certify data on the blockchain, ensuring immutability, transparency, and security. These APIs facilitate account management, network configuration, data signing, and transaction monitoring, making it easier for enterprises to integrate blockchain-based certification into their workflows.

This library is designed for developers who need to verify, sign, and submit data certificates using the Circular blockchain while maintaining seamless integration with Python applications.

Installation

You can install the Circular Enterprise APIs via npm:

pip install circular-enterprise-apis

Usage example

from circular_enterprise_apis import CEP_Account

try:
    # Instantiate the CEP Account class
    account = CEP_Account()
    print("CEP_Account instantiated successfully.")

    address = "your-account-address"
    private_key = "your-private-key"
    blockchain = "blockchain-address"
    tx_id = ""
    tx_block = ""

    account.set_network("testnet")
    account.set_blockchain(blockchain)
    print("Test variables set.")

    if account.open(address):
        print("Account opened successfully.")

        if account.update_account():
            print(f"Nonce: {account.Nonce}")

            tx_id_temp = account.submit_certificate(
                "your-data-to-certificate",
                private_key
            )
            if tx_id_temp["Result"] == 200:
                tx_id = tx_id_temp["Response"]["TxID"]
                print(f"TxID: {tx_id}")

                resp = account.get_transaction_outcome(tx_id, 25)
                if resp["Response"]["BlockID"]:
                    block_id = resp["Response"]["BlockID"]
                    status = account.get_transaction(block_id, tx_id)

                    if status["Result"] == 200:
                        print(f"Transaction Status: {status['Response']['Status']}")
                        account.close()
                    else:
                        print("Error on retrieving transaction")
                else:
                    print("Error on retrieving transaction status")
            else:
                print("Certificate submission error")
        else:
            print(f"Update Account Error: {account.lastError}")
    else:
        print(f"Failed to open account: {account.lastError}")
except Exception as e:
    print(f"An error occurred: {e}")

Useful Links

PreviousCEP_Account.close()NextCEP_Account.open()

Last updated 10 days ago

You can find more on the or on the .

official GitHub repository
official PYPI repository