Skip to main content

A validator for package names, namespace, username and app name on wasmer

Project description


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:

  1. Start with an alphabet character
  2. Have one or more alphanumeric characters, _ or -
  3. 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.


cargo add polyvalid
use polyvalid;

let name: String = "polyvalid";



pip add polyvalid
import polyvalid

name = "polyvalid"
polyvalid.is_name_valid(name) # returns True


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)


Contributions are welcome! If you'd like to contribute to polyvalid, please follow these steps:

  1. Fork the repo and create a new branch for your changes.
  2. Make your changes, write tests, and ensure that the tests pass.
  3. Submit a pull request to the polyvalid repo.
  4. Wait for feedback or approval from the maintainers.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyvalid-0.1.5.tar.gz (681.1 kB view hashes)

Uploaded Source

Built Distribution

polyvalid-0.1.5-py3-none-any.whl (688.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page