Skip to content

Instantly share code, notes, and snippets.

@joedf
Last active August 19, 2025 15:19
Show Gist options
  • Select an option

  • Save joedf/743655222da1279e8dc21f85ce9ad46a to your computer and use it in GitHub Desktop.

Select an option

Save joedf/743655222da1279e8dc21f85ce9ad46a to your computer and use it in GitHub Desktop.
How to extract the package version number from a pyproject.toml file

How to extract the package version number from a pyproject.toml file

windows commmand prompt

type pyproject.toml | sed -nr 's/^version\s*[^=]\s*\"(.+)\"$/\1/p'

bash

cat pyproject.toml | sed -nr 's/^version\s*[\^=]\s*"(.+)"$/\1/p'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment