Metadata-Version: 2.1
Name: asaniczka
Version: 3.1.0
Summary: All my commonly used fuctions
Author-email: Asaniczka <asaniczka@gmail.com>
Maintainer-email: Asaniczka <asaniczka@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/asaniczka/asaniczka_pip
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pytz>=2022.1
Requires-Dist: requests>=2.0
Requires-Dist: playwright>=1.0.0
Requires-Dist: tqdm>=4.0.0
Requires-Dist: httpx>=0.20.0
Requires-Dist: pydantic>=2.0

# 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

```python
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()
```
