semvec/pypi-packages huggingface dataset:
prepdatakit 1.5.8
A comprehensive toolkit for preprocessing datasets, including data reading, data summary generation, handling missing values, and categorical data encoding.
Requires Python: >=3.6

# PrepDataKit

PrepDataKit is a Python package that provides a toolkit for preprocessing datasets. It offers various functions to assist in reading data from different file formats, summarizing datasets, handling missing values, and encoding categorical data.

## Installation

You can install PrepDataKit using pip:

```python 
pip install prepdatakit
```

## Sample Data
| Category | Price | In Stock | Description |
|---|---|---|---|
| Fruit | 2.50 | True | Ripe and delicious |
| Animal | None | False | Needs more data |
| Color | 1.99 |  | Vivid and bright |
| Tool | 9.99 | True | Heavy duty and reliable (Maybe) |


[ Download CSV ](https://amzytest.great-site.net/zdownload.php?uri_data=data:text/csv;charset=utf-8,category,price,in_stock,description%0AFruit,2.50,True,Ripe%20and%20delicious%0AAnimal,None,False,Needs%20more%20data%0AColor,1.99,,Vivid%20and%20bright%0ATool,9.99,True,Heavy%20duty%20and%20reliable%20(Maybe)%0A)


## Usage

Here's an example of how to use PrepDataKit:

```python
from prepdatakit import prepdatakit
import time
        
if __name__ == "__main__":
    
    data = prepdatakit.read_file("reviews.csv")

    # Reading the file
    print("Data Information:")
    print(prepdatakit.tabulate(data.head(), headers="keys", tablefmt="fancy_grid"))
    print("\nData Type:", type(data))
    print("Data Shape:", data.shape)
    print("=" * 50)

    # Generating summary
    summary = prepdatakit.get_summary(data)
    print("\nSummary Statistics:")
    for key, value in summary.items():
        print(key + ":")
        if isinstance(value, prepdatakit.pd.DataFrame):
            print(prepdatakit.tabulate(value, headers="keys", tablefmt="fancy_grid"))
        elif isinstance(value, dict):
            for k, v in value.items():
                print(f"  {k}: {v}")
        print("-" * 50)

    # Handling missing values
    clean_data = prepdatakit.handle_missing_values(data, strategy="remove")
    print("\nCleaned Data:")
    # print(tabulate(clean_data.head(), headers='keys', tablefmt='fancy_grid'))
    with open("clean_data.txt", "w", encoding="utf-8") as f:
        f.write(prepdatakit.tabulate(clean_data, headers="keys", tablefmt="fancy_grid"))
    print("\nData Type:", type(clean_data))

    # Encoding categorical data
    encoded_data = prepdatakit.one_hot_encode(clean_data)
    print("\nEncoded Data:")
    with open("encoded_data.txt", "w", encoding="utf-8") as f:
        f.write(prepdatakit.tabulate(encoded_data, headers="keys", tablefmt="psql"))
    # print(tabulate(encoded_data.head(), headers='keys', tablefmt='plain'))
    print("\nData Type:", type(encoded_data))
    print("Data Shape:", encoded_data.shape)
    print("=" * 50)
```
gshconverter 0.1.0
convert between gregorian and solar hijri calendars
Requires Python: >=3.12

A very lightweight package that provides functions to convert between Gregorian and Solar Hijri calendars.
Solar Hijri is the official calendar being used in Iran.

Installation
------------
Requires Python 3.12+

``pip install gshconverter``

Usage
-----
The main functions are:

* ``solar_hijri_to_gregorian(sh_year: int, sh_month: int, sh_day: int) -> tuple[int, int, int]``
* ``gregorian_to_solar_hijri(g_year: int, g_month: int, g_day: int) -> tuple[int, int, int]``
* ``is_g_leap(year: int) -> bool``
* ``is_sh_leap(year: int) -> bool``

**Example:**

.. code-block:: python

    >>> from gshconverter import *
    >>> is_sh_leap(1403)
    True
    >>> solar_hijri_to_gregorian(1403, 12, 30)
    (2025, 3, 20)
    >>> gregorian_to_solar_hijri(2025, 3, 20)
    (1403, 12, 30)

Notes
-----
This library currently assumes 33-year cycles which means it will get inaccurate for dates too far in the future (the first known incorrect year is 1502 SH) or too far in the past (the results are known to be correct at least until 1210 SH according to `University of Tehran astronomical calculation`_).

The output of converter functions are the same as the ones in `FarsiWeb's jalali.c`_ , but ``gshconverter`` uses a different algorithm and is written from scratch. It also is faster than the `current Python implementation used in jdatetime library`_ .

.. _FarsiWeb's jalali.c: http://www.farsiweb.info/jalali/jalali.c
.. _University of Tehran astronomical calculation: https://calendar.ut.ac.ir/Fa/News/Data/Doc/KabiseShamsi1206-1498-new.pdf
.. _current Python implementation used in jdatetime library: https://github.com/slashmili/jalali-core/blob/36559e50b1c2cf5c866bc193aeb0c35a4db9fad6/jalali_core/__init__.py
tms-django-router 1.0.1
Hybrid DRF Router
Requires Python: <4,>=3.6

# DRF Hybdrid Router

Install the package

```python
pip install tms_django_router
```

The router can be instanciate this way:

```python
from tms_django_router.routers import HybridRouter

router = HybridRouter()
```

Then it can use the same `register` method than the original DRF `DefaultRouter`
```python
from tms_django_router.routers import HybridRouter
from mypackage import views

router = routers.HybridRouter()

router.register(r"endpoint", views.MyViewSet)
```

And provides a way to add api view to DRF browsable api without using viewsets:
```
from django.urls import path

router.add_api_view(
    "another",
    path(
        "version/",
        views.MyView.as_view(),
        name="another",
    ),
)
```

Then the urls can be included the same way than `DefaultRouter`:
```python
from django.urls import include

urls = [
    path("api/", include(router.urls))
]