Asaniczka
The Asaniczka module provides quick functions to get up and running with a scraper.
Installation
To install Asaniczka, you can use pip:
pip install asaniczka
Note:
- Remember to run
playwright installon cmd/terminal after installation to install playwright browsers - Remember to lock in the version of this package that you're using. Backwards compatibilty between major & minor versions is not guranteed
Usage
import asaniczka
import asaniczka.db_tools as dbt
import asaniczka.scrape_helper as ash
# Create project folders, creates a logger instance & start a stopwatch
project = asaniczka.ProjectSetup("MyProject")
# Save content to a temporary file
project.save_temp_file("Content")
# Format an error
formatted_error = asaniczka.format_error(error)
# Make a GET request
response = asaniczka.get_request(url)
# Make a POST request
response = asaniczka.post_request(url)
# Make an asynchronous GET request
response = await asaniczka.async_get_request(url)
# Make an asynchronous POST request
response = await asaniczka.async_post_request(url)
# Generate a random ID
random_id = asaniczka.generate_random_id()
# Save a dictionary as ndjson format
asaniczka.save_ndjson({"name": "raw dict"}, f"{project.data_folder}/my.ndjson")
# Create a new directory
my_dir = asaniczka.create_dir(os.path.join(project.data_folder, "my_data"))
# Check the ratelimit of a website
rate_limit = ash.check_ratelimit("https://amazon.com")
# Sanitize a filename
clean_filename = asaniczka.sanitize_filename("my)829filename")
# Start a stopwatch and calculate time taken
stopwatch = asaniczka.Stopwatch()
time_taken = stopwatch.lap()
Metadata
Release files for asaniczka 3.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asaniczka-3.1.4.tar.gz | 17.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asaniczka-3.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.6 kB
Release files / asaniczka-3.1.4.tar.gz
| Download URL | asaniczka-3.1.4.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
713a56b58049491048f56f51c2f9a26968dfdced84ad16814a2b33f69b00e6f6
|
|
BLAKE2b-256 checksum How to use checksums |
a3fc658956ecec10a9cd2b1428c9c05e2c4d667610e486db45a773a7adecdba1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|
Release files / asaniczka-3.1.4-py3-none-any.whl
| Download URL | asaniczka-3.1.4-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12b37d088647151b5a794aece27e59c8fc8059ebedd160687bfa29eb52fb1ce7
|
|
BLAKE2b-256 checksum How to use checksums |
7955884b3f17c3f99602b9882af59ec067a3950291b08f0a73dcf1b1790b64c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|