Saas MS Library
Saas MS Library is a Python library designed to be a utility for OMS microservices. This library provides an easy-to-use and highly customizable solution for reusing application utilities and clients, allowing developers to focus on creating the most efficient and scalable microservice.
With Saas MS Library, you will be able to handle AWS databases and clients. Our library is compatible with Python 3.10 and later versions, and is under constant development to improve its performance and extend its functionality.
Features
- Database Handler (MongoDB, Redis, PostgreSQL, etc.)
- AWS Client Handler (Cognito, S3, etc.)
- Decorators
Installation
To install saas-ms-library, simply run the following command:
pip install saas-ms-library
Examples of use
Here are some examples of how to use saas-ms-library in your projects:
Create environment variables
GRPC_PORT=50051
GRPC_MAX_WORKERS=10
SERVICE_ID=saas-ms-user
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
Use
from protos.v1.users import user_pb2, user_pb2_grpc
from omni.pro.decorators import resources_decorator
from omni.pro.util import HTTPStatus, Resource, deep_search, nested
class UserService(user_pb2_grpc.UsersServiceServicer):
@resources_decorator([Resource.AWS_COGNITO, Resource.MONGODB])
def UserCreate(
self, request: user_pb2.UserCreateRequest, context
) -> user_pb2.UserCreateResponse:
response = context.cognito_client.create_user(
username=data["username"],
password=data["password"],
name=data["name"],
email=data["email"],
tenant=data["tenant"],
language_code=data["language"]["code"],
timezone_code=data["timezone"]["code"],
)
att_list = nested(response, "User.Attributes") or nested(response, "UserAttributes", default=[])
sub_dict = deep_search(att_list, key, value)
user = context.db_manager.get_document(
context.db_name, UserDocument, sub=sub_dict.get("Value")
)
return user_pb2.UserCreateResponse(
response_standard=base_pb2.ResponseStandard(
success=True,
message="User created",
status_code=HTTPStatus.CREATED
),
user=user.to_proto(),
)
License
Saas MS Library is licensed under the modified MIT License.
Metadata
Release files for omni-pro 0.1.228
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 |
|---|---|---|---|---|
| omni-pro-0.1.228.tar.gz | 255.9 kB | Without provenance | Details for omni-pro-0.1.228.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| omni_pro-0.1.228-py3-none-any.whl | Python 3 | none | any | Details for omni_pro-0.1.228-py3-none-any.whl |
Total release size: 815.5 kB
Release files / omni-pro-0.1.228.tar.gz
| Download URL | omni-pro-0.1.228.tar.gz |
|---|---|
| Size | 255.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35a9e630760511b52cae38b66003c5e0a120470ae10f198152128e6cb9bc688d
|
|
BLAKE2b-256 checksum How to use checksums |
ae815084ac3dd4f7a0a272b8d1624065d0eff6ec015b94bb4f353bd8246545d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / omni_pro-0.1.228-py3-none-any.whl
| Download URL | omni_pro-0.1.228-py3-none-any.whl |
|---|---|
| Size | 559.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8c40ab25ed567df2e2585a81c50f73aff8b026d32786756eddf69d1905dbbac
|
|
BLAKE2b-256 checksum How to use checksums |
dccd662ea8429e9e0e3861a4e834d8aea8ecfc6736d5fc21708ef860a1789377
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for omni-pro 0.1.228
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.