IndexJson#
IndexJson
#
arch: Optional[str]
property
writable
#
Optionally, the architecture the package is build for.
Examples#
build_number: int
property
writable
#
The build number of the package. This is also included in the build string.
Examples#
features: Optional[str]
property
writable
#
Features are a deprecated way to specify different feature sets for the conda solver. This is not
supported anymore and should not be used. Instead, mutex
packages should be used to specify
mutually exclusive features.
Examples#
timestamp: Optional[datetime.datetime]
property
writable
#
The timestamp when this package was created
Examples#
>>> idx_json = IndexJson.from_path(
... "../test-data/conda-22.11.1-py38haa244fe_1-index.json"
... )
>>> idx_json.timestamp
datetime.datetime(2022, 12, 7, 23, 45, 42, 50000, tzinfo=datetime.timezone.utc)
>>> idx_json.timestamp = datetime.datetime(2021, 1, 1, 1, 1, 1, 50000, tzinfo=datetime.timezone.utc)
>>> idx_json.timestamp
datetime.datetime(2021, 1, 1, 1, 1, 1, 50000, tzinfo=datetime.timezone.utc)
>>>
track_features: List[str]
property
writable
#
Track features are nowadays only used to downweight packages (ie. give them less priority). To that effect, the number of track features is counted (number of commas) and the package is downweighted by the number of track_features.
Examples#
version: Version
property
writable
#
The version of the package.
Examples#
>>> idx_json = IndexJson.from_path(
... "../test-data/conda-22.11.1-py38haa244fe_1-index.json"
... )
>>> idx_json.version
VersionWithSource(version="22.11.1", source="22.11.1")
>>> idx_json.version = VersionWithSource("1.02.3")
>>> idx_json.version
VersionWithSource(version="1.2.3", source="1.02.3")
>>>
__repr__()
#
Returns a representation of the IndexJson.
from_package_archive(path)
staticmethod
#
Parses the package file from archive.
Note: If you want to extract multiple info/*
files then this will be slightly
slower than manually iterating over the archive entries with
custom logic as this skips over the rest of the archive
from_package_directory(path)
staticmethod
#
Parses the object by looking up the appropriate file from the root of the specified Conda archive directory, using a format appropriate for the file type.
For example, if the file is in JSON format, this function reads the appropriate file from the archive, parse the JSON string and return the resulting object. If the file is not in a parsable format or if the file could not be read, this function returns an error.
from_str(string)
staticmethod
#
Parses the object from a string, using a format appropriate for the file type.
For example, if the file is in JSON format, this function parses the JSON string and returns the resulting object. If the file is not in a parsable format, this function returns an error.
package_path()
staticmethod
#
Returns the path to the file within the Conda archive.
The path is relative to the root of the archive and includes any necessary directories.