Skip to main content

A call-effect-commit schema for safe data management in Python

Project description

CEfC

A call-effect-commit schema for safe data management Python.

This a metaprogramming framework that enables the safe execution of Python code by tracking data modifications and commiting to them only after functions complete their runs without errors. You can create fast-failing services that can rerun with new inputs from the same uncorrupted state.

The framework also treats exceptions-as-values, meaning that you can check the validity of return arguments if you want, otherwise they are cascaded throughout service calls.

:zap: Quickstart

Install CEfC per pip install cefc. Then create and run the following code snippet:

from cefc import service

@service
def func(a: list, b: int):
    a[0] = 1
    a[0] /= b

@service
def outer_func(a: list, b:int):
    return func(a, b)

a = [1,2,3]
outer_func(a, b=0)
print(a)

You will see the following output, where a is unaffected by would-be modifications and there is a final warning about not having handled the division-by-zero error at any point.

Error example

:hammer_and_wrench: Safe types

This is a list of types whose safety is (planned to be) guaranteed when presented as service arguments. Note that the safety of global state is not guaranteed, but globals can be passed as preset arguments too.

  • list
  • dict
  • numpy array or GPU tensor
  • object

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

cefc-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cefc-0.0.1-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file cefc-0.0.1.tar.gz.

File metadata

  • Download URL: cefc-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cefc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fbbd746e95cb96a6c168c3fd93adf90aec7e2d5336a18f25e498f341751f689b
MD5 29e8f013dc2e3f3a56a26acd69e36c8d
BLAKE2b-256 f37ede12e9b3c945deb771b95d1a3be457ba0c4f14c5fe85e48c69dcd7f9c95c

See more details on using hashes here.

File details

Details for the file cefc-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cefc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cefc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f76e9d16d33fcb1e9b11ec6ca16d06be2d19a9f44c0ea20b67855965666adb1f
MD5 6ebc875b5ee6d4769b0701d559d8a8cb
BLAKE2b-256 627905a12f6375091bd7105093d5924a55cc0738b62a31fb9f560fc3d348116c

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