Skip to main content

Parse a cargo workspace and analyze its packages

Project description

Cargo Workspace

Parse Rust Workspace files from a Cargo.toml file.

Example

from cargo_workspace import Workspace

# Path can be a file or directory:
workspace = Workspace.from_path('Cargo.toml')

for crate in workspace.crates:
	print(f'crate at {crate.path} has name {crate.name}')

Note that this crate uses getter functions instead of the conventional

Metadata

The metadata of each crate is accessible like so:

meta = crate.workspace.get('some.custom.key')

if meta not None:
	print(f'custom metadata found: {meta}')

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

cargo_workspace-1.2.1.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

cargo_workspace-1.2.1-py3-none-any.whl (4.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