Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: New type ISBN #116

Merged
merged 12 commits into from
Jan 2, 2024
Merged

Add: New type ISBN #116

merged 12 commits into from
Jan 2, 2024

Conversation

lucasmucidas
Copy link
Contributor

@lucasmucidas lucasmucidas commented Dec 28, 2023

Implementation of issue-115


ISBN

The pydantic_extra_types.isbn module provides functionality to receive and validate ISBN
(International Standard Book Number) in 10-digit and 13-digit formats. The output is always ISBN-13.

Using

    from pydantic import BaseModel

    from pydantic_extra_types.isbn import ISBN

    class Book(BaseModel):
        isbn: ISBN

    book = Book(isbn="8537809667")
    print(book)

output:

#> isbn='9788537809662'

Coverage

image

Selected Reviewer: @yezz123

Copy link

codecov bot commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0ce9f20) 100.00% compared to head (630ef92) 100.00%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #116   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9        10    +1     
  Lines          642       688   +46     
  Branches       159       176   +17     
=========================================
+ Hits           642       688   +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yezz123
Copy link
Collaborator

yezz123 commented Dec 28, 2023

please review

@yezz123
Copy link
Collaborator

yezz123 commented Dec 29, 2023

hey @lucasmucidas can you fix the formatting issue in the code 🙏🏻

@lucasmucidas
Copy link
Contributor Author

lucasmucidas commented Dec 29, 2023

Sorry @yezz123, i think that's ok rn.

About the docs on pydantic main repo: What should i do?

@yezz123 yezz123 linked an issue Jan 2, 2024 that may be closed by this pull request
Copy link
Collaborator

@yezz123 yezz123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pydantic_extra_types/isbn.py Show resolved Hide resolved
pydantic_extra_types/isbn.py Outdated Show resolved Hide resolved
@yezz123 yezz123 merged commit 084ce94 into pydantic:main Jan 2, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Type: ISBN (International Standard Book Number)
2 participants