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.5

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.5
File Size Uploaded Provenance Actions
logsfacilitator-0.1.5.tar.gz 4.9 kB Without provenance Details for logsfacilitator-0.1.5.tar.gz

Built distribution (wheel)

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

Total release size: 10.8 kB

Release files / logsfacilitator-0.1.5.tar.gz

Download URL logsfacilitator-0.1.5.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f6a2dbf12134e32be1e1d03fce231a4ccf1bcca81f922ec9254bc517fa0f4939
BLAKE2b-256 checksum
How to use checksums
f76f1285ce9f6c29074d417db5301ce784e44a40ec71e750f883b7e2af7e5d97
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.5-py3-none-any.whl

Download URL logsfacilitator-0.1.5-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b427c3b49822b89cc4725654f9b66aae02f3f767f0dd3173b660d927492006e
BLAKE2b-256 checksum
How to use checksums
579f8cb664ea66439d86af2d5c0c039924f9922cc372ec0ca212e6cf2df89064
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.5

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