Skip to main content

yarn.lock file parser

Project description

yarnlock

PyPI - Python Version Liberapay Patrons GitHub Sponsors

Quickly parse yarn dependencies information into a Python dictionary. The output is typed using a TypedDict class, making it more convenient to work with.

Installation

The recommended installation method is through the PyPI package manager. The project is implemented in Rust and several pre-built binary wheels are available for Linux, macOS, and Windows, with support for both x64 and ARM architectures.

pip install yarnlock

Basic usage

from pathlib import Path
from yarnlock import yarnlock_parse

yarnlock_parse(Path('yarn.lock').read_text())
# ->
# {
#     '@babel/cli': {
#         'matches': ['^7.24.8'],
#         'dependencies': {
#             'glob': '^7.2.0',
#             'slash': '^2.0.0',
#             'make-dir': '^2.1.0',
#             'commander': '^6.2.0',
#             'convert-source-map': '^2.0.0',
#             'fs-readdir-recursive': '^1.1.0',
#             '@jridgewell/trace-mapping': '^0.3.25',
#         },
#         'optionalDependencies': {
#             'chokidar': '^3.4.0',
#             '@nicolo-ribaudo/chokidar-2': '2.1.8-no-fsevents.3',
#         },
#         'version': '7.24.8',
#         'resolved': 'https://registry.npmjs.org/@babel/cli/-/cli-7.24.8.tgz',
#         'integrity': 'sha512-isdp+G6DpRyKc+3Gqxy2rjzgF7Zj9K0mzLNnxz+E/fgeag8qT3vVulX4gY9dGO1q0y+0lUv6V3a+uhUzMzrwXg==',
#     },
#     ...
# }

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

yarnlock-1.0.0.tar.gz (134.0 kB view hashes)

Uploaded Source

Built Distributions

yarnlock-1.0.0-cp38-abi3-win_amd64.whl (104.9 kB view hashes)

Uploaded CPython 3.8+ Windows x86-64

yarnlock-1.0.0-cp38-abi3-musllinux_1_2_x86_64.whl (398.4 kB view hashes)

Uploaded CPython 3.8+ musllinux: musl 1.2+ x86-64

yarnlock-1.0.0-cp38-abi3-musllinux_1_2_aarch64.whl (414.0 kB view hashes)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

yarnlock-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (217.2 kB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

yarnlock-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (208.3 kB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

yarnlock-1.0.0-cp38-abi3-macosx_11_0_arm64.whl (196.9 kB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

yarnlock-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl (204.8 kB view hashes)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

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