Pagidantic

Latest version: v2.0.0

Safety actively analyzes 622959 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.0.0

We are thrilled to announce the release of Pagidantic version 2.0.0, a significant milestone in our journey. This release brings about several important changes and enhancements, including the drop of Pydantic version 1 support. Below, we outline the key updates and improvements.

Major Changes 🚑️

1. Migration to Pydantic v2
- **Feature**: Pagidantic now exclusively supports Pydantic version 2, as implemented in https://github.com/yezz123/pagidantic/commit/47c330f05476b61bbcf2b0601f28917c2f7f902f & https://github.com/yezz123/pagidantic/commit/69be792621375e3eafc25966fde2f4c0ca1d94a8
- **Impact**: Users must update their code to align with the changes introduced in Pydantic v2.

2. Python Version Support
- **Support**: Pagidantic 2.0.0 supports Python versions 3.12.

Dependency Updates ⬆️

* ⬆ Bump pytest from 7.3.1 to 7.3.2 by dependabot in https://github.com/yezz123/pagidantic/pull/34
* ⬆ Bump pytest from 7.3.2 to 7.4.0 by dependabot in https://github.com/yezz123/pagidantic/pull/36
* ⬆ Bump pre-commit from 3.3.2 to 3.3.3 by dependabot in https://github.com/yezz123/pagidantic/pull/35
* ⬆ Bump mypy from 1.3.0 to 1.4.1 by dependabot in https://github.com/yezz123/pagidantic/pull/37
* ⬆ Update typing-extensions requirement from <4.7.0,>=3.7.4 to >=3.7.4,<4.8.0 by dependabot in https://github.com/yezz123/pagidantic/pull/39
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 by dependabot in https://github.com/yezz123/pagidantic/pull/40
* ⬆ Update typing-extensions requirement from <4.8.0,>=3.7.4 to >=3.7.4,<4.9.0 by dependabot in https://github.com/yezz123/pagidantic/pull/50
* ⬆ Bump pytest from 7.4.0 to 7.4.2 by dependabot in https://github.com/yezz123/pagidantic/pull/49
* ⬆ Bump pre-commit from 3.3.3 to 3.4.0 by dependabot in https://github.com/yezz123/pagidantic/pull/47
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.7 to 1.8.10 by dependabot in https://github.com/yezz123/pagidantic/pull/43
* ⬆ Bump actions/checkout from 3 to 4 by dependabot in https://github.com/yezz123/pagidantic/pull/46
* ⬆ Bump pytest-asyncio from 0.21.0 to 0.21.1 by dependabot in https://github.com/yezz123/pagidantic/pull/41
* ⬆ Bump mypy from 1.4.1 to 1.5.1 by dependabot in https://github.com/yezz123/pagidantic/pull/45
* ⬆ Bump mypy from 1.5.1 to 1.6.1 by dependabot in https://github.com/yezz123/pagidantic/pull/53
* ⬆ Bump pre-commit from 3.4.0 to 3.5.0 by dependabot in https://github.com/yezz123/pagidantic/pull/52
* ⬆ Bump pytest from 7.4.2 to 7.4.3 by dependabot in https://github.com/yezz123/pagidantic/pull/54
* ⬆ Bump mypy from 1.6.1 to 1.7.0 by dependabot in https://github.com/yezz123/pagidantic/pull/55
* ⬆ Bump pytest-asyncio from 0.21.1 to 0.23.2 by dependabot in https://github.com/yezz123/pagidantic/pull/57
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.10 to 1.8.11 by dependabot in https://github.com/yezz123/pagidantic/pull/58
* ⬆ Bump mypy from 1.7.0 to 1.8.0 by dependabot in https://github.com/yezz123/pagidantic/pull/62
* ⬆ Update typing-extensions requirement from <4.9.0,>=3.7.4 to >=3.7.4,<4.10.0 by dependabot in https://github.com/yezz123/pagidantic/pull/61
* ⬆ Bump pre-commit from 3.5.0 to 3.6.0 by dependabot in https://github.com/yezz123/pagidantic/pull/60
* ⬆ Bump actions/setup-python from 4 to 5 by dependabot in https://github.com/yezz123/pagidantic/pull/59
* ⬆ Bump pytest-asyncio from 0.23.2 to 0.23.3 by dependabot in https://github.com/yezz123/pagidantic/pull/64
* ⬆ Bump pytest from 7.4.3 to 7.4.4 by dependabot in https://github.com/yezz123/pagidantic/pull/63
* ⬆ Bump actions/cache from 3 to 4 by dependabot in https://github.com/yezz123/pagidantic/pull/65
* ⬆ Update pydantic requirement from <2.5.3,>=2.0.0 to >=2.0.0,<2.5.4 by dependabot in https://github.com/yezz123/pagidantic/pull/67


**Full Changelog**: https://github.com/yezz123/pagidantic/compare/1.1.0...2.0.0

1.1.0

What's Changed

Fixes 🐛
* chore: Add `mypy` & Enhance typing in pagidantic by yezz123 in https://github.com/yezz123/pagidantic/pull/28
* 👷 updating Testing workflow & Add Cache Clean workflow by yezz123 in https://github.com/yezz123/pagidantic/pull/33

Dependencies 🔨
* ⬆ Bump pre-commit from 2.21.0 to 3.0.0 by dependabot in https://github.com/yezz123/pagidantic/pull/2
* ⬆ Bump pre-commit from 3.0.0 to 3.0.1 by dependabot in https://github.com/yezz123/pagidantic/pull/3
* ⬆ Bump pre-commit from 3.0.1 to 3.1.0 by dependabot in https://github.com/yezz123/pagidantic/pull/10
* ⬆ Bump mypy from 0.991 to 1.0.1 by dependabot in https://github.com/yezz123/pagidantic/pull/9
* ⬆ Update typing-extensions requirement from <4.5.0,>=3.7.4 to >=3.7.4,<4.6.0 by dependabot in https://github.com/yezz123/pagidantic/pull/8
* ⬆ Bump pytest from 7.2.1 to 7.2.2 by dependabot in https://github.com/yezz123/pagidantic/pull/12
* ⬆ Bump pre-commit from 3.1.0 to 3.1.1 by dependabot in https://github.com/yezz123/pagidantic/pull/11
* ⬆ Bump mypy from 1.0.1 to 1.1.1 by dependabot in https://github.com/yezz123/pagidantic/pull/13
* ⬆ Bump pypa/gh-action-pypi-publish from 1.6.4 to 1.7.1 by dependabot in https://github.com/yezz123/pagidantic/pull/14
* ⬆ Bump pypa/gh-action-pypi-publish from 1.7.1 to 1.8.1 by dependabot in https://github.com/yezz123/pagidantic/pull/15
* ⬆ Bump pre-commit from 3.1.1 to 3.2.0 by dependabot in https://github.com/yezz123/pagidantic/pull/16
* ⬆ Bump pytest-asyncio from 0.20.3 to 0.21.0 by dependabot in https://github.com/yezz123/pagidantic/pull/17
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 by dependabot in https://github.com/yezz123/pagidantic/pull/18
* ⬆ Bump pytest from 7.2.2 to 7.3.0 by dependabot in https://github.com/yezz123/pagidantic/pull/23
* ⬆ Bump mypy from 1.1.1 to 1.2.0 by dependabot in https://github.com/yezz123/pagidantic/pull/22
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.5 by dependabot in https://github.com/yezz123/pagidantic/pull/20
* ⬆ Bump pre-commit from 3.2.0 to 3.2.2 by dependabot in https://github.com/yezz123/pagidantic/pull/21
* ⬆ Bump pytest from 7.3.0 to 7.3.1 by dependabot in https://github.com/yezz123/pagidantic/pull/24
* ⬆ Bump pre-commit from 3.2.2 to 3.3.1 by dependabot in https://github.com/yezz123/pagidantic/pull/26
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 by dependabot in https://github.com/yezz123/pagidantic/pull/27
* ⬆ Bump mypy from 1.2.0 to 1.3.0 by dependabot in https://github.com/yezz123/pagidantic/pull/29
* ⬆ Bump pre-commit from 3.3.1 to 3.3.2 by dependabot in https://github.com/yezz123/pagidantic/pull/30
* ⬆ Bump pytest-cov from 4.0.0 to 4.1.0 by dependabot in https://github.com/yezz123/pagidantic/pull/32
* ⬆ Update typing-extensions requirement from <4.6.0,>=3.7.4 to >=3.7.4,<4.7.0 by dependabot in https://github.com/yezz123/pagidantic/pull/31

New Contributors
* dependabot made their first contribution in https://github.com/yezz123/pagidantic/pull/2

**Full Changelog**: https://github.com/yezz123/pagidantic/compare/1.0.0...1.1.0

1.0.0

![Logo](https://raw.githubusercontent.com/yezz123/pagidantic/main/.github/logo.png)

<p align="center">
<em>Pagination using Pydantic. Easy to use, lightweight, and easy to integrate with existing projects ✨</em>
</p>

Installation

You can add Pagidantic in a few easy steps. First of all, install the dependency:

shell
$ pip install pagidantic

---> 100%

Successfully installed pagidantic


Usage

py
from pagidantic import pagidantic

Generate a list here: https://json-generator.com/
object_list = [...] list of objects


pagination = pagidantic(object_list, page_limit=2, start_page=0)

get current returned page
def get_current_page():
return pagination.response


get next pageg
def get_next_page():
return pagination.get_next()


get previous page
def get_previous_page():
return pagination.get_previous()


get page by number
def get_page_by_number():
return pagination.get_page_response(page_number=0)


get total pages
def get_total_pages():
return pagination.total_pages


Count total objects
def count_total_objects():
return pagination.total


**Full Changelog**: https://github.com/yezz123/pagidantic/commits/1.0.0

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.