Skip to main content

logsfacilitator

This library aims to facilitate logging memory consumption and execution time for functions. Additionally, it centralizes utility functions shared across multiple projects, making it easier to access and reuse this code.


English | Português (Brasil)


How to Install

Install via pip:

pip install logsfacilitator

How to Use

import logsfaciliti 


Decorators

The included decorators are used to record resource consumption and function execution time.

measure_time

Measures the time taken to run the function. The result can be printed in the terminal or logged in a file.

Args:
    folder (str): Name of the folder where the log will be saved. The function automatically checks if this folder exists.
    writer_log (bool, optional): If True, records the log in the file. If False, prints the log to the console. Default is True.

measure_memory

Measures the RAM memory consumption used to run the function. The result can be printed in the terminal or logged in a file.

Args:
    folder (str): Name of the folder where the log will be saved. The function automatically checks if this folder exists.
    writer_log (bool, optional): If True, records the log in the file. If False, prints the log to the console. Default is True. 

measure_time

Simultaneously measures the execution time and RAM memory consumption of the function. The result can be printed in the terminal or logged in a file.

Args:
    folder (str): Name of the folder where the log will be saved. The function automatically checks if this folder exists.
    writer_log (bool, optional): If True, records the log in the file. If False, prints the log to the console. Default is True.

Functions

check_existence_of_folder

Checks for the existence of a folder in a directory and returns the full path if it exists. Otherwise, it moves up one directory level and checks again recursively until it finds the folder or reaches the root directory.

Args:
    current_directory (str): Starting directory for the search. Default is the current working directory.
    folder (str): Name of the folder to be checked.
    old_directory (str, optional):Previous directory. Default is None.

Retorna :
    str: Full path to the folder.

Raises: 
    FileNotFoundError: If the folder is not found at any level up to the root directory..

set_list_float

Receives a string and transforms it into a list of decimal numbers (float).

Args:
    varia (str): Name of the variable to display in the console prompt (if console=True), or the actual string with comma-separated values to be converted into the list (if console=False).
    console(bool,optional): If True, prompts the user for an input in the terminal. If False, uses the string provided in the varia argument.

Retorno:
    (list[float]): A list containing the numeric values.

set_list_int

Receives a string and transforms it into a list of int

Args:
    varia (str): Name of the variable to display in the console prompt (if console=True), or the actual string with comma-separated values to be converted into the list (if console=False).
    console(bool,optional): If True, prompts the user for an input in the terminal. If False, uses the string provided in the varia argument.

Retorno:
   (list[int]): A list containing the numeric values.

Metadata

Release files for logsfacilitator 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logsfacilitator 0.1.7
File Size Uploaded Provenance Actions
logsfacilitator-0.1.7.tar.gz 5.0 kB Without provenance Details for logsfacilitator-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for logsfacilitator 0.1.7
File Interpreter ABI Platform Actions
logsfacilitator-0.1.7-py3-none-any.whl Python 3 none any Details for logsfacilitator-0.1.7-py3-none-any.whl

Total release size: 11.0 kB

Release files / logsfacilitator-0.1.7.tar.gz

Download URL logsfacilitator-0.1.7.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7cd99f77b58df4a2c1f1ad56096ede1d9852d1aa03e8feb050673103e6d71d97
BLAKE2b-256 checksum
How to use checksums
b21c423e4b8f4de1fe676a242d65f258034c59ff8b64f1f5f1dbfd3b3e91f29c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / logsfacilitator-0.1.7-py3-none-any.whl

Download URL logsfacilitator-0.1.7-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6600c9ab7b4b810437e6c44b66b06eb1e0848d120731b08d17476dc05aaecca
BLAKE2b-256 checksum
How to use checksums
4432ed040864e94882a04ead40902e3932c35d2c21c9c32b1e9e02b625a16326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for logsfacilitator 0.1.7

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page