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.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| logsfacilitator-0.1.6.tar.gz | 5.0 kB | Without provenance | Details for logsfacilitator-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| logsfacilitator-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for logsfacilitator-0.1.6-py3-none-any.whl |
Total release size: 10.8 kB
Release files / logsfacilitator-0.1.6.tar.gz
| Download URL | logsfacilitator-0.1.6.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02275321f021c41d9b2ec44e70985f08d79fd1b18b98b4ecacc89879035595e8
|
|
BLAKE2b-256 checksum How to use checksums |
67893890a575e35e6c074099a189a3408d5aa81b333d3628cce7a3fd3c588c37
|
| 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.6-py3-none-any.whl
| Download URL | logsfacilitator-0.1.6-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
932ca58af1b884bdfe159c9f44e440213b440a0e8dc946da2767bebbcc105ee7
|
|
BLAKE2b-256 checksum How to use checksums |
bc602e81d0e5fe49110d21d4fac0f1ad2a40a1d9869b3b9510c43a3bf8cce63e
|
| 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.6
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.