Skip to main content

Yarn JS package manager lockfile parser

Project description

Coverage Status

PYarn

If, for some weird reason, you need to parse a Yarn's yarn.lock file using Python, you are in the right place!

PYarn is currently in an early developmente stage. It will create a dict from a yarn.lock file, given the yarn.lock file is correct as per its implementation. At this moment, there is no guarantees that PYarn will behave well (e.g., raise an error) in case a malformed Yarn lockfile is passed to PYarn.

PYarn only supports Yarn v1 lockfiles. Parsing Yarn v2 lockfiles should be trivial since they are yaml files.

Development

make devel
make check

Usage

The following prints all the content in the yarn.lock file:

from pyarn import lockfile

my_lockfile = lockfile.Lockfile.from_file(FILE_NAME)
print(my_lockfile.data)
# or
my_lockfile.to_json()

my_lockfile.data is a dict where the top level keys are the top level entries (i.e., the package names) for the yarn.lock file entries.

Releasing

Before releasing a new version to PyPI, don't forget to bump the version number in setup.cfg.

Make sure to git tag the release commit with the corresponding version and create a Github release explaining what is new.

Afterwards, releasing to PyPI is quite simple:

make build
twine check dist/*
twine upload dist/*

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

pyarn-0.2.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

pyarn-0.2.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file pyarn-0.2.0.tar.gz.

File metadata

  • Download URL: pyarn-0.2.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for pyarn-0.2.0.tar.gz
Algorithm Hash digest
SHA256 542ff739af2b81a1200776eff2b4d2566a330846decbd0f815999b196d7b067d
MD5 374c45807b59dd89464f1dc32e6b5298
BLAKE2b-256 55d4b504f7acfe5ba3b9dcc65042bd8c7e3ea6ed6d17d31eddb9b2b57259e88a

See more details on using hashes here.

File details

Details for the file pyarn-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyarn-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for pyarn-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d06e8b79bb830f142187b57ee664dc0104f658efdb2b2bae7ed99eaf7746eb1a
MD5 5c5a91e67a6cb4c373c4eaccc034a3b7
BLAKE2b-256 56b2364628359ecd772c50107a3bd6e4ca30ec32a26a2a60591698002469bf0b

See more details on using hashes here.

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