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.savetempfile(content, extension='txt', file_name=None)
# Format an error
formattederror = asaniczka.formaterror(error)
# Make a GET request
responsecontent = asaniczka.getrequest(url)
# Create a new directory
asaniczka.createdir(folderpath)
# 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.1.6.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for asaniczka-1.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 894bb0585d6fc7fd8e7b77438e05e4345df112ed34e5f2c519f8de3cce69e0cd |
|
MD5 | 37f7649f65d112a371e8a1d141a8a99e |
|
BLAKE2b-256 | 6f4abd04edb053e433bc457147ed18d5531cfc322c3eb3ddf92071436be662dd |