Functions-SDK for Python
This SDK provides the csfunctions library for developing Functions with Python.
Functions are deeply integrated in the CIM Database Cloud Webhooks technology. They are designed to work seamlessly together. The goal is to allow implementing custom business logic in a CIM Database Cloud SaaS application without leaving the CONTACT Cloud and without the need to create and maintain a separate infrastructure.
Documentation: https://cslab.github.io/functions-sdk-python/
Source code: https://github.com/cslab/functions-sdk-python
Requirements
Python 3.10+
csfunctions is built with Pydantic 2
Installation
Install using pip:
pip install contactsoftware-functions
Usage
Build the Function
Folder content of a minimal example for a Function implementation:
my_example_functions/
├── environment.yaml
├── mymodule.py
└── requirements.txt
Code for a Function:
import requests
import json
from csfunctions import MetaData, Service
from csfunctions.events import DocumentReleaseEvent
def send_doc_to_erp(metadata: MetaData, event: DocumentReleaseEvent, service: Service):
# iterate over the documents contained in the event
for document in event.data.documents:
# create the payload for our (fictional ERP system)
payload = json.dumps({
"document_number": document.z_nummer,
"document_index": document.z_index,
"document_title": document.titel
})
res = requests.post("https://example.com", data=payload)
if res.status_code != 200:
return ValueError(f"Failed to upload document to ERP. Got response code {res.status_code}")
Environment file to define runtime and Function entrypoints:
runtime: python3.10
version: v1
functions:
- name: send_doc_to_erp
entrypoint: mymodule.send_doc_to_erp
Define requirements:
contactsoftware-functions
Deploy the Code
To deploy the Code you first need to install the contactsoftware-functions-client and retrieve developer credentials in the CONTACT Portal.
Install client:
pip install contactsoftware-functions-client
Login:
cfc login
Create a new environment:
cfc env create myenv
Upload code into new environment:
cfc env deploy myenv
Metadata
Release files for contactsoftware-functions 0.29.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| contactsoftware_functions-0.29.0.tar.gz | 295.1 kB | Without provenance | Details for contactsoftware_functions-0.29.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| contactsoftware_functions-0.29.0-py3-none-any.whl | Python 3 | none | any | Details for contactsoftware_functions-0.29.0-py3-none-any.whl |
Total release size: 347.2 kB
Release files / contactsoftware_functions-0.29.0.tar.gz
| Download URL | contactsoftware_functions-0.29.0.tar.gz |
|---|---|
| Size | 295.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb5f1ac7a4cf079f069766fe1293295d679fa9c19d4ba77e10e8499cccf9be93
|
|
BLAKE2b-256 checksum How to use checksums |
a1999b0d768d2a895aea4342b1b2b620845dfd4e4082f561089eb0f78d5deecd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / contactsoftware_functions-0.29.0-py3-none-any.whl
| Download URL | contactsoftware_functions-0.29.0-py3-none-any.whl |
|---|---|
| Size | 52.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f762b464328c4295b3d9f14ca1343d3d3e17e8760ecefbc8fbe5c034b08335a
|
|
BLAKE2b-256 checksum How to use checksums |
8a0bb740bd02fe028af121440cdbeb6151641dff1591176619510cd1d2439245
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for contactsoftware-functions 0.29.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.