Skip to main content

All my commonly used fuctions

Project description

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 install on 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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asaniczka-3.1.4.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asaniczka-3.1.4-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file asaniczka-3.1.4.tar.gz.

File metadata

  • Download URL: asaniczka-3.1.4.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for asaniczka-3.1.4.tar.gz
Algorithm Hash digest
SHA256 713a56b58049491048f56f51c2f9a26968dfdced84ad16814a2b33f69b00e6f6
MD5 087e210e63be178fb5623b643ffd11ce
BLAKE2b-256 a3fc658956ecec10a9cd2b1428c9c05e2c4d667610e486db45a773a7adecdba1

See more details on using hashes here.

File details

Details for the file asaniczka-3.1.4-py3-none-any.whl.

File metadata

  • Download URL: asaniczka-3.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for asaniczka-3.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 12b37d088647151b5a794aece27e59c8fc8059ebedd160687bfa29eb52fb1ce7
MD5 c41adba89d6b5941b1014196aed88a04
BLAKE2b-256 7955884b3f17c3f99602b9882af59ec067a3950291b08f0a73dcf1b1790b64c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page