Skip to main content

pysolbase

Welcome to pysol

Copyright (C) 2013/2025 Laurent Labatut / Laurent Champagnac

pysolbase is a set of python helpers to ease development.

It is gevent (co-routines) based.

Usage

Engage gevent monkey patching and setup default logger configuration:

SolBase.voodoo_init()

Initialize logging system (without engaging gevent) with default configuration (ie console logs - there is support for syslog and file logs).

SolBase.logging_init("INFO")

Re-initialize logging system (without engaging gevent):

SolBase.logging_init("DEBUG", True)

Millis helpers:

ms = SolBase.mscurrent()
do_something()
ms_elapsed = SolBase.msdiff(ms)

Date helpers

dt = SolBase.datecurrent()
do_something()
ms_elapsed = SolBase.datediff(dt)

Binary helpers

bin_buf = SolBase.unicode_to_binary('This is my text buffer', encoding='utf-8')
unicode_string = SolBase.binary_to_unicode(bin_buf, encoding='utf-8')

File helpers

FileUtility.append_text_to_file('/tmp/test.txt', 'This is my text buffer', 'utf-8')
bin_buf = FileUtility.file_to_binary('/tmp/test.txt')
unicode_string = FileUtility.file_to_text('/tmp/test.txt', 'utf-8')

Exception helper

try:
   a = None
   b = a + 1
except Exception as e:
   logger.warn("Ex=%s", SolBase.extostr(e))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysolbase-3.13.6.tar.gz (26.0 kB view details)

Uploaded Source

File details

Details for the file pysolbase-3.13.6.tar.gz.

File metadata

  • Download URL: pysolbase-3.13.6.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pysolbase-3.13.6.tar.gz
Algorithm Hash digest
SHA256 3a847fc1fa91d72c77080b988442c9b63609ba63bdd2218e25c9296295353fd0
MD5 708c66a67bd5d3ff3a63e294a9480542
BLAKE2b-256 ab8f163bf13e9d8e3bb0a5698b7311aa181dec5a9932dab584e2189ce68b3c8d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.13.6 This release

1 file

3.13.5

1 file

3.13.4

1 file

3.13.3

1 file

3.13.2

1 file

3.13.1

1 file

3.13.0

1 file

3.11.1

1 file

3.11.0

1 file

3.0.3

1 file

3.0.2

1 file

3.0.1

1 file

3.0.0

1 file

1.1.8

1 file

1.1.7

1 file

1.1.6

1 file

1.1.5

1 file

1.1.4

1 file

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.5

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

Supported by

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