All my commonly used fuctions
Project description
Asaniczka
The Asaniczka module provides quick functions to get up and running with a scraper.
Available Functions:
setup_logger()
: Set up a logger and return the logger instance.save_temp_file()
: Saves the given content to a temporary file in the specified temp folder.format_error()
: Removes newlines from the given error string.get_request()
: Makes a basic HTTP GET request to the given URL.create_dir()
: Creates a new directory.
Available Classes:
ProjectSetup
: A class that sets up project folders and provides access to their paths.
Installation
To install Asaniczka, you can use pip:
pip install asaniczka
Usage
python import asaniczka
# Set up a logger
logger = asaniczka.setup_logger("/path/to/log/file.log")
# Save content to a temporary file
asaniczka.save_temp_file(content, extension='txt', file_name=None)
# Format an error
formattederror = asaniczka.format_error(error)
# Make a GET request
responsecontent = asaniczka.get_request(url)
# Create a new directory
asaniczka.create_dir(folder_path)
# Create project folders
project = asaniczka.ProjectSetup("MyProject")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asaniczka-1.2.0.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for asaniczka-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eab0abaff7e9887bc52b7dd7948ffd55406f1343a2a7b74386f5e32aa6b5b03c |
|
MD5 | a95bcf851c14b49398895f2ab6bf8090 |
|
BLAKE2b-256 | 9391f2e654d9244ab95c3ad1e3cb11cf9289a6d331686bddf7625b3d28b3326e |