https://github.com/onuralpszr/yuko
Yuko is a Python package that provides Rust-backed validators for common validation tasks.
https://github.com/onuralpszr/yuko
hacktoberfest python rust validator validators yuko
Last synced: about 1 year ago
JSON representation
Yuko is a Python package that provides Rust-backed validators for common validation tasks.
- Host: GitHub
- URL: https://github.com/onuralpszr/yuko
- Owner: onuralpszr
- License: mit
- Created: 2023-11-16T20:49:32.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-21T21:59:45.000Z (about 1 year ago)
- Last Synced: 2025-04-21T22:34:56.557Z (about 1 year ago)
- Topics: hacktoberfest, python, rust, validator, validators, yuko
- Language: Rust
- Homepage: https://github.com/onuralpszr/yuko
- Size: 1010 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Yuko (有効)
[](https://opensource.org/licenses/MIT)
[](https://results.pre-commit.ci/latest/github/onuralpszr/yuko/main)
[](https://github.com/onuralpszr/yuko/actions/workflows/CI.yml)
[](https://github.com/onuralpszr/yuko/actions/workflows/Coverage-CI.yml)
[](https://codecov.io/gh/onuralpszr/yuko)
[](https://www.codefactor.io/repository/github/onuralpszr/yuko)
Yuko is a Python package that provides Rust-backed validators for common validation tasks. This project aims to enhance the performance of validation operations by leveraging Rust's speed ⚡️, while still being easily accessible from Python.
## 🛠 Installation
```bash
pip install yuko
```
## 🔥 Usage
```python
>>> import yuko
>>> yuko.email('loremipsum@example.com')
True
>>> yuko.email('loremipsum')
False
>>> yuko.country_code('TR')
True
>>> yuko.country_code('INVALID')
False
>>> yuko.ip_address("127.0.0.1","ipv4")
True
>>> yuko.ip_address("257.0.0.1","ipv4")
False
>>> yuko.ip_address("1:2:3:4:5:6:7:8", "ipv6")
True
>>> yuko.ip_address("0.0.0.0", "both")
True
>>> yuko.domain("example.com")
True
>>> yuko.domain("example.com.")
False
>>> yuko.domain("example")
False
>>> yuko.mac_address("01:23:45:67:ab:CD")
True
>>> yuko.mac_address("00:1A:2B:3C:4D:ZZ")
False
>>> yuko.md5("d41d8cd98f00b204e9800998ecf8427e")
True
```
## 🔮 Features
Yuko provides validators of the following:
- Email Validation
- Country Code(Alpha-3, Alpha-2, Numeric) Validation
- IP Address (ipv4, ipv6, both) Validation
- Domain Validation
- Mac Address Validation
- Hash (MD5, SHA1, SHA224, SHA256, SHA512) Validation
- URL Validation
## 💻 Adding New Validators
If you want to contribute a new validator, please follow these guidelines:
* Create a new Rust module for your validator in the src directory.
* Implement the validator logic in Rust.
* Expose the validator as a Python module using the pyo3 crate.
* Update the Python package accordingly.
## Credits
This project inspired by [Validators](https://github.com/python-validators/validators)
