Using of CREDITS API in Python 3 (demo)

Requirements

Windows x64

Download CREDITS API files: https://github.com/CREDITSCOM/thrift-interface-definitions

Development Environment: https://www.jetbrains.com/pycharm/

Additional libraries:

base58

thrift

Create Application

You have to add them via the PyCharm IDE package manager, for example:

Create console applications (Python 3) in PyCharm IDE

CREDITS API Source Code Generation

Open the folder which you have used for download of Credits API from the GitHub, for example, in d: \ credits \ github \ CS-API \

Let's say thrift is installed to the folder: d: \ vcpkg \

execute commands:

D: \ vcpkg \ packages \ thrift_x64-windows \ tools \ thrift \ thrift.exe --gen py api.thrift

D: \ vcpkg \ packages \ thrift_x64-windows \ tools \ thrift \ thrift.exe --gen py variant.thrift

As the result will be a folder with files: gen-cpp, copy the files from the folder to the folder of our application, for example in: d: \ credits \ app \ app \

Add files to our project

Add the code

Python
Copy

Check the performance. Call the GetBalance Method.

As the result of the program we see the requested balance:

GitHub link: https://github.com/pvl1175/CreditsPythonApiDemo

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard