semvec/pypi-packages huggingface dataset:
hentai-chan-api 1.0.2
Wrapper over https://hentaichan.live | There is also an asynchronous version, go to github
License: MIT
Requires Python: >=3.7

[![PyPI version](https://badge.fury.io/py/hentai-chan-api.svg)](https://badge.fury.io/py/hentai-chan-api)
![PyPI - License](https://img.shields.io/pypi/l/hentai-chan-api)

# HentaiChanApi
## Wrapper over https://hentaichan.live

hentai-chan-api is a small parser library 
that will allow you to easily use manga from https://hentaichan.live
Recommended to use python3.7+

Async version: [@HentaiChanApi-async](https://github.com/JKearnsl/HentaiChanApi-async)

## Install

```sh
pip install hentai-chan-api
```

## Features

- Parsing by pages and quantities
- Search engine by queries and by tags
- Manga object to easily retrieve manga data
- Ability to use a proxy

## Examples

An example of using the 'get_new' method:
```Python
from hentai_chan_api import HentaiChan

hc = HentaiChan()

manga = hc.get_new(page_num=1, count=2)

for el in manga:
    print(el.id)  # '40918-doll-house-glava-2'
    print(el.title)  # 'Doll House - глава 2'
    print(el.poster)  # https://imgcover.../.../01.jpg'
    print(el.series)  # 'Оригинальные работы'
    print(el.author)  # 'Sexgazers'
    print(el.translator)  # 'Zone'
    print(el.content.images)  # ['https://.../.png', 'https://.../.png'...]
    print(el.tags)  # ['анал', 'без цензуры', 'большая грудь', ...]
    print(el.date)  # '17 января 2022'
    
```
Note that the arguments: "page_num=1" and "count=2" are optional.
By default, "page_num=1" and "count=20".

Also note that calling "el.content.images" will invoke the parser, which may take some time to use. I advise you to call "el.content.images" only when necessary.


Tag search example:
```Python
from hentai_chan_api import HentaiChan

hc = HentaiChan()

tags = hc.get_all_tags()  # ['3D', 'action', 'ahegao', 'bdsm', 'corruption', ...]

manga = hc.search(tag=tags[0])  # [Manga(id='40779-ms-i', title='Ms. I (Невыразимые секреты её прошлого)', post...)...]
print(manga[0].title)  # Ms. I (Невыразимые секреты её прошлого)
print(manga[0].content.images)  # ['https://mimg2.imgschan.xyz/manganew/m/1641154521_ms.-i/001.jpg', 'https://...', ...]

```

Search query example:
```Python
from hentai_chan_api import HentaiChan

hc = HentaiChan()

tags = hc.get_all_tags()  # ['3D', 'action', 'ahegao', 'bdsm', 'corruption', ...]

manga = hc.search(page_num=3, query='bikini')  # [Manga(...)...]
print(manga[0].title)  # Bikini's Bottom
print(manga[0].content.images)  # ['https://mimg2.imgschan.xyz/manganew/l/1630962513_lightsource-bikinis-bot...', ...]
```
django-partial-date 1.3.2
Django custom model field for partial dates with the form YYYY, YYYY-MM, YYYY-MM-DD
License: MIT
Keywords: fields,django,dates,partial

django_partial_date
================

Django custom model field for partial dates with the form YYYY, YYYY-MM, YYYY-MM-DD

 * Works with DRF
 * Supports comparison operations
 * Supports Django versions 2.0, 3.0 and 4.0

Usage
================

install the package

```bash
pip install django_partial_date
```


## partial_date.PartialDateField

A django model field for storing partial dates. Accepts None, a partial_date.PartialDate object, or a formatted string such as YYYY, YYYY-MM, YYYY-MM-DD. In the database it saves the date in a column of type DateTimeField and uses the seconds to save the level of precision.

## class partial_date.PartialDate

Object to represent the partial dates.

## Example

models.py
```python
from django.db import models
from partial_date import PartialDateField

class TestModel(models.Model):
    some_partial_date = PartialDateField()
```

```python
>>> from partial_date import PartialDate
>>> from core.models import TestModel
>>> obj = TestModel(some_partial_date="1995")
>>> obj.save()
>>> obj.some_partial_date
'1995'
>>> obj.some_partial_date = PartialDate("1995-09")
>>> obj.save()
>>> obj.some_partial_date
1995-09
>>>
```

```python
>>> from partial_date import PartialDate
>>> import datetime
>>> partial_date_instance = PartialDate(datetime.date(2012, 9, 21), precision=PartialDate.DAY)
>>> partial_date_instance
2012-09-21
>>> partial_date_instance.precisionYear()
False
>>> partial_date_instance.precisionMonth()
False
>>> partial_date_instance.precisionDay()
True
>>> partial_date_instance.precision == PartialDate.YEAR
False
>>> partial_date_instance.precision == PartialDate.MONTH
False
>>> partial_date_instance.precision == PartialDate.DAY
True
>>> partial_date_instance.precision = PartialDate.MONTH
>>> partial_date_instance
2012-09
>>> partial_date_instance = PartialDate("2015-11-01")
>>> partial_date_instance.date
datetime.date(2015, 11, 1)
```


```python
>>> from partial_date import PartialDate
>>> partial_date_instance = PartialDate("2015-11-01")
>>> partial_date_instance
2015-11-01
>>> partial_date_instance.format('%Y', '%m/%Y', '%m/%d/%Y') # .format(precision_year, precision_month, precision_day)
'11/01/2015'
>>> partial_date_instance = PartialDate("2015-11")
>>> partial_date_instance
2015-11
>>> partial_date_instance.format('%Y', '%m/%Y', '%m/%d/%Y')
'11/2015'
>>> partial_date_instance = PartialDate("2015")
>>> partial_date_instance
2015
>>> partial_date_instance.format('%Y', '%m/%Y', '%m/%d/%Y')
'2015'
```

Thanks for their collaborations to
- lorinkoz
- howieweiner
- jghyllebert
- sorinmarti