This is a zeep based SOAP client wrapper for simple communication with the Bricknode SOAP API.

Overview

BFS SOAP API wrapper

Simply specify the method you are interested in.

Instantiate client

from bfs import Bfs

config = {
  "bricknode": {
      "wsdl": "https://bfs1.bricknode.com/ENVIRONMENT_NAME/api/bfsapi.asmx?WSDL",
      "credentials": {
        "username": "ENVIRONMENT_USERNAME",
        "password": "ENVIRONMENT_PASSWORD"
      },
      "identifier": "ENVIRONMENT_IDENTIFIER"
    }
}

bfs = Bfs(config)

bfs.get

accounts = bfs.get(bfs.methods.GET_ACCOUNTS)

Filter using the args parameter, support for UUIDs and strings:

instrument = bfs.get(bfs.methods.GET_INSTRUMENTS, args={
    "BrickIds": ["59cc4559-7b6b-490e-816a-89ec12ed8e94"]
})

instrument = bfs.get(bfs.methods.GET_INSTRUMENTS, args={
    "ISINs": ["SE0006259594"]
})

bfs.create

Using the skip_validation_for_empty_values flag we can create a minimal object without the client protesting

person = {
    'FirstName': 'Jane',
    'LastName': 'Doe',
    'UserName': 'janedoe',
    'Password': 'janedoe.4.ever',
    'Email': '[email protected]',
    'Domain': 'Front',
    'IsNaturalPerson': True
}

created_persons = bfs.create(bfs.methods.CREATE_PERSONS, entities=[person], skip_validation_for_empty_values=True)

bfs.execute

The execute method is added for code clarity, it has the same internal requirements as create

transfer_orders = [{
        'FromAccountBrickId': 'fbce4894-5f3c-49c3-87c4-62e8f3dae52f',
        'ToAccountBrickId': 'ef403f20-dfa7-4930-9e65-409d744856f8',
        'Units': 607500,
        'Comment': 'My comment',
        'TradeDate': '2021-01-11',
        'SettlementDate': '2021-01-13',
        'ValueDate': '2021-01-11',
        'InstrumentBrickId': '142f5c35-26b3-4697-87ac-81e672280b17',
        'OverrideOwnershipChangeValidation': True
    }]

created_transfer_orders = bfs.create(bfs.methods.CREATE_INTERNAL_INSTRUMENT_TRANSFER_ORDERS, entities=transfer_orders,
                             skip_validation_for_empty_values=True)

entities = list(map(lambda o: {'InternalTransferOrderBrickId': o['BrickId']}, created_transfer_orders))
result = bfs.execute(bfs.methods.EXECUTE_INTERNAL_TRANSFER_ORDERS, entities=entities)

bfs.update

Unless we are skipping validation, Updating an object often requires posting an entire object in with valid values, even though you most likely only want to update a few completely different ones. It is then mostly helpful to get the object and then modify it.

persons = bfs.get(bfs.methods.GET_PERSONS, args={
    'BrickIds': ['6e12ec5a-89e0-4c63-a04c-32141ef90a04']
}))

update_person = persons[0]

You can then update the property you want to change, remember to define the fields you want affected. Any other fields updated will not be persisted.

update_person['Email'] = '[email protected]'

result = bfs.update(bfs.methods.UPDATE_PERSONS,
                    entities=[update_person],
                    fields={
                        'Email': True
                    })

bfs.delete

This can be used for deleting POAs and Allocation Profiles. Not supporting DeleteFile, which requires a FileInfoDelete object as input.

brick_ids = [
    '3038fc58-731b-47c4-ae55-0aada120e200',
    'a018c8f1-f3f1-4ac5-b392-a33e2167a17e'
]

result = bfs.delete(bfs.methods.DELETE_POAS, brick_ids=brick_ids)

bfs.cancel

Enables cancellation, adding an entity as WorkflowTriggerDataEntity of the cancel request.

entity = {
    'OrderNo': 123456
}

result = bfs.cancel(bfs.methods.CURRENCY_EXCHANGE_ORDER__CANCEL, entity=entity)
You might also like...
Very simple FTP client, sync folder to FTP server, use python, opensource
Very simple FTP client, sync folder to FTP server, use python, opensource

ftp-sync-python Opensource, A way to safe your data, avoid lost data by Virus, Randsomware Some functions: Upload a folder automatically to FTP server

Simple client for the Sirah Matisse Commander TCP server.

Simple client for the Sirah Matisse Commander TCP server.

Qobuz-rpc - A simple discord rich presence client for qobuz written in Python

qobuz-rpc A simple discord rich presence client for qobuz written in Python It's

A simple multi-threaded time server and client in python.

time-server-client A simple multi-threaded time server and client in Python. This uses the latest match/case command found in Python 3.10 so requires

Python Scrcpy Client - allows you to view and control android device in realtime
Python Scrcpy Client - allows you to view and control android device in realtime

Python Scrcpy Client This package allows you to view and control android device in realtime. Note: This gif is compressed and experience lower quality

A python socket.io client for Roboteur

Roboteur Client Example TODO Basic setup Install the requirements: $ pip install -r requirements.txt Run the application: $ python -m roboteur_client

(A)sync client for sms.ru with pydantic responses

🚧 aioSMSru Send SMS Check SMS status Get SMS cost Get balance Get limit Get free limit Get my senders Check login/password Add to stoplist Remove fro

A Simplest TCP client and echo server
A Simplest TCP client and echo server

Простейшие TCP-клиент и эхо-сервер Цель работы Познакомиться с приемами работы с сетевыми сокетами в языке программирования Python. Задания для самост

NanoChat - nano chat server and client
NanoChat - nano chat server and client

NanoChat This is a work in progress! NanoChat is an application for connecting with your friends using Python that uses ONLY default Python libraries.

Owner
Nord Fondkommission AB
Nord Fondkommission AB
This repository contain sample code of gRPC Communication between Python and GoLang

This repository contain sample code of gRPC Communication between Python and GoLang, the Server is running on GoLang while Python is running the client

Abdullahi Muhammad 2 Nov 29, 2021
A powerful framework for decentralized federated learning with user-defined communication topology

Scatterbrained Decentralized Federated Learning Scatterbrained makes it easy to build federated learning systems. In addition to traditional federated

Johns Hopkins Applied Physics Laboratory 7 Sep 26, 2022
PyBERT is a serial communication link bit error rate tester simulator with a graphical user interface (GUI).

PyBERT PyBERT is a serial communication link bit error rate tester simulator with a graphical user interface (GUI). It uses the Traits/UI package of t

David Banas 59 Dec 23, 2022
Client library for relay - a service for relaying server side messages to the client side browsers via websockets.

Client library for relay - a service for relaying server side messages to the client side browsers via websockets.

getme 1 Nov 10, 2021
This is a Client-Server-System which can share the screen from the server to client and in the other direction.

Screenshare-Streaming-Python This is a Client-Server-System which can share the screen from the server to client and in the other direction. You have

VFX / Videoeffects Creator 1 Nov 19, 2021
This is a Client-Server-System which can send audio from a microphone from the server to client and in the other direction.

Audio-Streaming-Python This is a Client-Server-System which can send audio from a microphone from the server to client and in the other direction. You

VFX / Videoeffects Creator 0 Jan 5, 2023
league-connection is a python package to communicate to riot client and league client

league-connection is a python package to communicate to riot client and league client.

Sandbox 1 Sep 13, 2022
A simple Encrypted IM chat software Server & client based on Python3.

SecretBox A simple Encrypted IM chat software Server & client based on Python3. Version 1.0 命令行版 安装步骤 Server 运行pip3 install -r requirements 安装依赖。 运行py

h3h3da 5 Oct 31, 2022
API to establish connection between server and client

Socket-programming API to establish connection between server and client, socket.socket() creates a socket object that supports the context manager ty

Muziwandile Nkomo 1 Oct 30, 2021
A simple DHCP server and client simulation with python

About The Project This is a simple DHCP server and client simulation. I implemented it for computer network course spring 2021 The client can request

shakiba 3 Feb 8, 2022