use-python-module 0.0.1

Python module and import metadata primitives for RustUse
Documentation
  • Coverage
  • 48.78%
    20 out of 41 items documented1 out of 23 items with examples
  • Size
  • Source code size: 13.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 991.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s 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-module

Python module, package, import, and path-label primitives for RustUse.

Experimental

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

Example

use use_python_module::{PythonImportKind, PythonModuleName};

let module = PythonModuleName::new("package.submodule")?;

assert_eq!(module.segments(), vec!["package", "submodule"]);
assert_eq!(PythonImportKind::Absolute.as_str(), "absolute");
# Ok::<(), use_python_module::PythonModuleNameError>(())

Scope

  • Lightly validated dotted module, package, and import names.
  • Import kind, module path, file kind, and package layout metadata.
  • ASCII identifier validation for each dotted segment.

Non-goals

  • Parsing Python source code or import statements.
  • Resolving modules on disk.
  • Complete package discovery or namespace-package behavior.

License

Licensed under either Apache-2.0 or MIT.