Skip to content

PrefixRecord#

PrefixRecord #

Bases: RepoDataRecord

extracted_package_dir property writable #

extracted_package_dir

The path that contains the extracted package content.

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> str(r.extracted_package_dir)
'C:\\Users\\bas\\micromamba\\pkgs\\requests-2.28.2-pyhd8ed1ab_0'
>>>

files property writable #

files

A sorted list of all files included in this package

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> r.files # doctest:+ELLIPSIS
[...]
>>>

package_tarball_full_path property writable #

package_tarball_full_path

The path to where the archive of the package was stored on disk.

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> str(r.package_tarball_full_path)
'C:\\Users\\bas\\micromamba\\pkgs\\requests-2.28.2-pyhd8ed1ab_0.tar.bz2'
>>>

paths_data property writable #

paths_data

Information about how files have been linked when installing the package.

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> r.paths_data # doctest:+ELLIPSIS
PrefixPaths(paths=[...])
>>>

requested_spec property writable #

requested_spec

The spec that was used when this package was installed (deprecated). Use requested_specs instead.

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> r.requested_spec is None
True
>>>

requested_specs property writable #

requested_specs

The specs that were used when this package was installed. If this package was not directly requested by the user but was instead installed as a dependency of another package an empty list will be returned.

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> r.requested_specs
[]
>>>

__repr__ #

__repr__()

Returns a representation of the version

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> r
PrefixRecord(name="requests", version="2.28.2")
>>>

from_path staticmethod #

from_path(path)

Parses a PrefixRecord from a file.

Examples#
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> assert isinstance(r, PrefixRecord)
>>>

write_to_path #

write_to_path(path, pretty)

Writes the contents of this instance to the file at the specified location.