Skip to main content

SEDEX Messagebox Manager

Project description

SEDEX Messagebox Manager

Purpose

This module simplifies the management of your message boxes with asynchronous data exchange via SEDEX. [https://www.bfs.admin.ch/bfs/de/home/register/personenregister/sedex/asynchron.html]

You can search your inbox for specific message types or receiving times, clean up your inbox or send messages. All this with a few simple lines of Python.

This module never interferes with the SEDEX core functionality of secure data transmission but simplifies the management of in- and outbox.

Install

pip install sedex

That's it.

Examples

Get started

Create instance by specifying in- and outbox.

from sedex import semebo

messagebox = semebo.MessageBox(inbox=r"C:\sedex\inbox", outbox=r"C:\sedex\outbox")

Search for Messages

Scan your inbox for messages fullfilling secified criteria.

Get all messages received within the last 24h:

import datetime

for message in messagebox.scan_inbox(from_date=datetime.datetime.now() - datetime.timedelta(hours=24)):
    print(message.data_file,
          message.envelope.sender_id,
          message.envelope.message_type)

Get the most recent message with message type 1819:

message = messagebox.scan_inbox(message_type=1819, latest=True):
print(message.data_file,
      message.envelope.sender_id,
      message.envelope.message_date)

Send Messages

Send the entire content of a folder:

data = r"C:\delivery\ready_to_ship"
transfer_id, envelope = messagebox.send_data(file_or_folder=data, recipient_id="CH1848", sender_id="Z!1819", message_type=1819)
print(transfer_id,
      envelope.message_id,
      envelope.message_date)

Clean-up Inbox

List candidates older than a week to preview cleanup:

messagebox.purge_inbox(older_than_days=7, dry_run=True)

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

sedex-0.1.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

sedex-0.1.4-py2-none-any.whl (6.2 kB view details)

Uploaded Python 2

File details

Details for the file sedex-0.1.4.tar.gz.

File metadata

  • Download URL: sedex-0.1.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.14

File hashes

Hashes for sedex-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0556be3447c560360981b600b2e48152b5a64a2ba9d39646956c3d8854e1fd6b
MD5 446f1635c39d038dc02c5672c9f68ab6
BLAKE2b-256 8d675f570704243e2ed7215e433095687020f6a08492b49327a4a69bfe3c1b48

See more details on using hashes here.

File details

Details for the file sedex-0.1.4-py2-none-any.whl.

File metadata

  • Download URL: sedex-0.1.4-py2-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.14

File hashes

Hashes for sedex-0.1.4-py2-none-any.whl
Algorithm Hash digest
SHA256 44006cbf89f3e139dbb998decc9a1760fe31387a6ad5b978ce53f71aaceb4fcb
MD5 6a9ab3ae3985987b6dc00c484fac3115
BLAKE2b-256 9d94848f9941ef49e07e4b2a653e58abcdd789342afac228966e01cdc2b1d8de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page