Skip to main content

Common libraries for DSC projects/services

Project description

DSC Labs common libraries.

A python3 library for commonly used utilities

Installation and Usage:

Install with pip

pip3 install dsc_labs -U --trusted-host 192.168.195.200 --no-cache-dir --extra-index-url http://192.168.195.200:8151/simple/

note: -U to upgrade to the latest version

Usage:

  1. Import libraries
# example: using logger from dsc_labs
from dsc_labs.libs.logger import DSCLabsLoggerMixin
from dsc_labs.common import current_utc_timestamp

class Timer(DSCLabsLoggerMixin):
    def __init__(self):
        super().__init__()
        
    def get_current_time(self):
        utc_time = current_utc_timestamp()
        # self.log is a method that inherits from `DSCLabsLoggerMixin` class
        self.log.info('event=get-current-time message="Current time: %s"', str(utc_time))
  1. Command line:
dsc_labs-config -h

dsc_labs-* ...

Package development

Install required libraries

pip install -r requirements.txt

Build

python setup.py sdist

Release

python -m twine upload --repository-url http://192.168.195.200:8151 -u USERNAME -p PASSWORD FILEPACKAGE

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

dsc_labs-1.0.1.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file dsc_labs-1.0.1.tar.gz.

File metadata

  • Download URL: dsc_labs-1.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.10

File hashes

Hashes for dsc_labs-1.0.1.tar.gz
Algorithm Hash digest
SHA256 036cc14c122959e3b21982691521ef3311effbb520ed9e55ec2490dcba1df5b8
MD5 a32d8b74d1029c9d57e19d2cb5965df9
BLAKE2b-256 d6e5602afe1d50c1fd7c793289cbac755b5bf8f6b41e8b6d82ae85f39ea17789

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