Skip to content

PrefixRecord#

PrefixRecord #

Bases: RepoDataRecord

extracted_package_dir: Optional[os.PathLike[str]] property writable #

The path that contains the extracted package content.

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

files: List[os.PathLike[str]] property writable #

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: Optional[os.PathLike[str]] property writable #

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"
... )
>>> r.package_tarball_full_path
'C:\\Users\\bas\\micromamba\\pkgs\\requests-2.28.2-pyhd8ed1ab_0.tar.bz2'
>>>

paths_data: PrefixPaths property writable #

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: Optional[str] property writable #

The spec that was used when this package was installed. Note that this field is not currently updated if another spec was used. If this package was not directly requested by the user but was instead installed as a dependency of another package None will be returned.

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

__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(path) staticmethod #

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(path, pretty) #

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