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.steal_cookies()
: Steals the cookies from a given domain for SSRF
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
Note:
Remember to run playwright install
on cmd/terminal after installation to install playwright browsers
Usage
import asaniczka.main as asaniczka
# Create project folders
project = asaniczka.ProjectSetup("MyProject")
# Set up a logger
logger = asaniczka.setup_logger(project.log_file_path)
# Save content to a temporary file
asaniczka.save_temp_file(content, extension='txt')
# Format an error
formatted_error = asaniczka.format_error(error)
# Make a GET request
response = asaniczka.get_request(url)
# Create a new directory
my_dir = asaniczka.create_dir(os.path.join(project.data_folder,'my_data'))
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-2.0.3.tar.gz
(12.0 kB
view hashes)
Built Distribution
asaniczka-2.0.3-py3-none-any.whl
(12.8 kB
view hashes)
Close
Hashes for asaniczka-2.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1424e63230f60affc7367e84fe4c5cd2c4f39ad3f24182469390da4fd2fd6487 |
|
MD5 | 933be399f2c5b0e1bb961fbdaabbf73c |
|
BLAKE2b-256 | d9a490d294d753826d7361f07314ae7432cb67de7a4fad7e20d16fd2d82b1c02 |