Skip to main content

Roberts base module

Project description

rvr.base

This is Roberts personal base module. Currently it provides the following functionality:

  • Logging to Azure log analytics
  • Sending notifications using https://notify.run/
  • Querying configuration from a single configuration (.ini) file.

Prerequistes

You'll need an Azure log analytics workspace. This is where the logs are send to. This module is developed for Linux and tested only on Ubuntu 20.04 using Python 3.8.10.

The configurationfile The configuration file is used for some configuration settings like the Log analytics workspace and password... it's a bad practice I know... Perhaps I'll improve the security later on. The file is located in '/etc/rvr/config.ini'.

The file requires the following content:

[AZ_LOG_ANALYTICS_WORKSPACE]
workspace_id = ID OF YOUR WORKSPACE
primary_key = THE KEY OF  YOUR WORKSPACE

Building

Prerequistes for building Make sure you'll have the following PIP packages installed:

  • wheel
  • setuptools
  • twine

Build the module Make sure the cursor is the root folder of the project and run: python3 -m build

Using the module

An example says more than 1000 words in my opinion. Please see the example.py file in this project for examples.

Distributing the module

python3 -m twine upload dist/* --verbose -u

testing the build module

Yeah I know this isn't proper testing but for now I've got to do with it. Here is an example:

# create a Python virtual environment:
python3 -m venv venv

# Make the environment active
source venv/bin/activate

# Install the build module
pip3 install dist/rvrbase-<VERSION AND THE REST OF THE FILE>

#Run the example script
python3 example.py

Other sources used

https://packaging.python.org/en/latest/tutorials/packaging-projects/

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

rvr-base-0.0.1.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

rvr_base-0.0.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

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