Skip to main content

Upload Python Package

SEPA-python3-APIs

Client-side libraries for the SEPA platform (Python3)

Installation and usage

$ pip3 install sepy

Clone the repository.

cd SEPA-python3-APIs
sudo python3 setup.py build
sudo python3 setup.py sdist
sudo python3 setup.py install

To use the classes you have to import them in this way:

from sepy.<the class you want to import> import *

For example, if you want to import the SAPObject (used to handle JSAP files) you have to write:

from sepy.SAPObject import *

This library consists of 5 modules that can be used for different purposes:

  • SAPObject: An handler class for SAP files
  • SEPA: A low-level class used to develop a client for SEPA
  • ConnectionHandler: A class for connection handling
  • Exceptions
  • tablaze: A runnable script (also callable as a function, to nicely print SEPA output)

Let's talk about some classes deeply:

SEPA

These APIs allow to develop a client for the SEPA platform using a simple interface. First of all the class SEPA must be initialized. Then the standard methods to interact with the broker are available.

Parameters:

  • sapObject : A SAPObject file Default = None
  • logLevel : A number indicating the desired log level. Default = 40 The parameters are optional. If present, they activate query, update, subscribe, methods by SAPObject pick. If absent, only the equivalnt sparql_* methods are available, giving the host communication information each time.

Attributes:

  • logger
  • sap: the SAPObject
  • connectionManager : The underlying responsible for network connections

Creating a SEPA client

mySAP = open(path_to_sap,"r")
sap = SAPObject(yaml.load(mySAP))
sc = SEPA(sapObject=sap)

Query and Update

These four methods (query, sparql_query, update, sparql_update, query_all, clear) expect either a sap entry or a SPARQL query/update. In addition, it is possible to overwrite the sap communication parameters with sepa. When a new query/update is issued, it may be preferrable to catch the RegistrationFailedExceptions, TokenExpiredException and TokenRequestFailedException errors. The query methods return the SEPA answer.

Subscribe and Unsubscribe

The subscribe and sparql_subscribe primitive requires a sap entry or a SPARQL query, an alias for the subscription, an handler (a lambda expression or a method with two parameters, one for added, the other for removed) and if needed the overwriting params for communication. The unsubscribe primitive only needs to know the ID of the subscription.

SAPObject

This package supports Semantic Application Profiles. The package is encoding free, since it expects a dictionary in input. Therefore, for a ysap we have

mySAP = open(path_to_sap,"r")
sap = SAPObject(yaml.load(mySAP))

while for a jsap we have

mySAP = open(path_to_sap,"r")
sap = SAPObject(json.load(mySAP))

Something else?

Documentation is being written...

Foreseen changes

Minors, plus the addition of some utilities.

Metadata

Release files for sepy 0.43.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sepy 0.43.2.1
File Size Uploaded Provenance Actions
sepy-0.43.2.1.tar.gz 17.3 kB Without provenance Details for sepy-0.43.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sepy 0.43.2.1
File Interpreter ABI Platform Actions
sepy-0.43.2.1-py3-none-any.whl Python 3 none any Details for sepy-0.43.2.1-py3-none-any.whl

Total release size: 42.6 kB

Release files / sepy-0.43.2.1.tar.gz

Download URL sepy-0.43.2.1.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
603693efe712c9f693a7fcd29272ab8bab5c356b7a2ae60d829065e923240370
BLAKE2b-256 checksum
How to use checksums
683dcda5b875c89c5aaf4cae2ad6992361b02019a4d9cd0ede7db52501aa7528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / sepy-0.43.2.1-py3-none-any.whl

Download URL sepy-0.43.2.1-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ed6649bd0b69352c96a56a70cbb074aa40aabaaabdb300554ce6f5bcfaabea3
BLAKE2b-256 checksum
How to use checksums
fda2b07d50a04f08d894658a0520d755590699eb86f790b220e14a793b57a6d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Security for sepy 0.43.2.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page