use-python-identifier 0.0.1

ASCII-safe Python identifier primitives for RustUse
Documentation
  • Coverage
  • 61.54%
    16 out of 26 items documented1 out of 16 items with examples
  • Size
  • Source code size: 12.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 648.06 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-python
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-python-identifier

ASCII-safe Python identifier primitives for RustUse.

Experimental

use-python-identifier is experimental while use-python remains below 0.3.0.

Example

use use_python_identifier::{PythonIdentifier, is_valid_ascii_python_identifier};

let identifier = PythonIdentifier::new("async_task")?;

assert_eq!(identifier.as_str(), "async_task");
assert!(is_valid_ascii_python_identifier("_value_1"));
# Ok::<(), use_python_identifier::PythonIdentifierError>(())

Scope

  • Ordinary ASCII-safe Python identifier validation.
  • Hard Python keyword rejection through use-python-keyword.
  • Dunder-name and private-name metadata helpers.

Non-goals

  • Complete Unicode Python identifier validation.
  • Soft-keyword context analysis.
  • Python source-code parsing.

Unicode-complete Python identifier validation is future work.

License

Licensed under either Apache-2.0 or MIT.