polyvalid
polyvalid is a Rust library for validating package names, usernames, namespace names, and app names. The library provides a single source of truth for validating the names with the following rules:
- Start with an alphabet character
- Have one or more alphanumeric characters,
_or- - End with an alphanumeric character
Additionally, the library checks if the name contains -- since it can break URL rules.
The library can be used from Python and JS through the provided bindings.
Using the library
The library can be used from rust, python or javascript. The following describes how to use it from all three languages.
Rust
cargo add polyvalid
use polyvalid;
let name: String = "polyvalid";
assert!(polyvalid::is_app_name_valid(name));
Python
pip add polyvalid
import polyvalid
name = "polyvalid"
polyvalid.is_app_name_valid(name) # returns True
Javascript
npm i polyvalid
import "polyvalid";
name = "polyvalid";
polyvalid.is_valid_name(name); // returns true
Next steps
- Add CI to autopublish to wapm, pypi, npm
- Add tests for python and JS versions of the library
- Add wrapper around the python library (to improve usability)
Contributing
Contributions are welcome! If you'd like to contribute to polyvalid, please follow these steps:
- Fork the repo and create a new branch for your changes.
- Make your changes, write tests, and ensure that the tests pass.
- Submit a pull request to the
polyvalidrepo. - Wait for feedback or approval from the maintainers.
Metadata
Release files for polyvalid 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polyvalid-0.1.7.tar.gz | 684.7 kB | Without provenance | Details for polyvalid-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polyvalid-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for polyvalid-0.1.7-py3-none-any.whl |
Total release size: 1.4 MB
Release files / polyvalid-0.1.7.tar.gz
| Download URL | polyvalid-0.1.7.tar.gz |
|---|---|
| Size | 684.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
612d56e9f12ac416a8bf32b58ad32ad3d45af4a0cd7cfe06c0b1279fff7e6856
|
|
BLAKE2b-256 checksum How to use checksums |
f599fbb6a07680de8b287521fb494f5709a91b6eb5d30a1464bb2180b42684fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.2
|
Release files / polyvalid-0.1.7-py3-none-any.whl
| Download URL | polyvalid-0.1.7-py3-none-any.whl |
|---|---|
| Size | 691.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67694dad207a82152da1b1cb339773e45940066f277e9a96c8f9c7e8e8a4ff91
|
|
BLAKE2b-256 checksum How to use checksums |
8e1a98b9b82b86c10977c919266dfd11faa56625d502af5544a79457258d58a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.2
|
Security for polyvalid 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.