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

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.4
File Size Uploaded Provenance Actions
logsfacilitator-0.1.4.tar.gz 4.8 kB Without provenance Details for logsfacilitator-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 10.7 kB

Release files / logsfacilitator-0.1.4.tar.gz

Download URL logsfacilitator-0.1.4.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0fdb40baeee6f7b43e73160b90fb66e6242097f56dfa0d767ff85e2718ff0c30
BLAKE2b-256 checksum
How to use checksums
daebd029f31d3df62b5ebae8d05233382dfa880c141f7dc120f34e8f4d41c839
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.4-py3-none-any.whl

Download URL logsfacilitator-0.1.4-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82ff1faa192e167cefee7c0067497e22166af184acb57c1074e0ca4f9d5f50ba
BLAKE2b-256 checksum
How to use checksums
e79d282e2c7ff0a32b80904993090ec8b4f4a1396f4d88526d7d45cb9f31398c
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.4

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