Skip to main content

My neat tools grouped together!

Project description

Photonic Utilities Library

Description

Photonic is the library where I upload all my neat tools!

_logging

This package is designed to make logging easier and customizable.

Quick start:

  1. You need to configure your logger before using it, here is an example:

    logger_name = "my_logger"

    console_config(logger_name) # This makes the logger log to the console (with colors)! json_file_config(logger_name) # This makes the logger log to a json file (more detailed too).

  2. Now, we are all set! To use the logger all you need to do is:

    logger = getLogger("my_logger")

    logger.debug(f"Test Message from logger.debug") logger.info(f"Test Message from logger.info") logger.warning(f"Test Message from logger.warning") logger.error(f"Test Message from logger.error") logger.critical(f"Test Message from logger.critical")

This code will log the messages to both the console and the json file.

You can use custom formats for the message or the provided formats in the logging.formatters.Format enum.

utils

Utils are a group of functions that are nice to have ready for you. Note: the functions currently in the package are meant to be used as a decorator. Example:

@threaded
def treaded_function():
    # some code

Now, threaded_function will start in a new thread whenever called.

enums

This package is a place where I put enums that I might use in the future. Currently, it has one enum called AnsiColor which contains some of the colors used in the console. Example:

print(AnsiColor.red.value + "Example Error Text." + AnsiColor.reset.value)

Contact Me!

If you have any suggestions to add to the library you can email me. I am open to any constructive criticism!

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

photonic-0.0.1.tar.gz (4.2 MB view details)

Uploaded Source

Built Distribution

photonic-0.0.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file photonic-0.0.1.tar.gz.

File metadata

  • Download URL: photonic-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for photonic-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0453829a3c4a5555b08cde0a0b5f1d8e4d68385576d06a5f83f9be53b49e54a0
MD5 62e7e6277fa294ad84a12a9f29de997c
BLAKE2b-256 7e84ffd9ae89dcf8fdff01a723a0d680a3c49e539f9eba7ed7663766043c1985

See more details on using hashes here.

File details

Details for the file photonic-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: photonic-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for photonic-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c8facba070a70e72c00b56ae5db496882bfcf9634eaec706e2b39b5c4426285
MD5 6237621dc4e873e1ac31627236f296bd
BLAKE2b-256 6c2b02eaebf00437a2344368ec1197446a22f30c1c5aee6f67b91fbf5cab6b4f

See more details on using hashes here.

Supported by

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