Skip to content

AboutJson#

AboutJson #

The about.json file contains metadata about the package.

channels: List[str] property #

A list of channels that where used during the build.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.channels
['https://conda.anaconda.org/conda-forge']
>>>

description: Optional[str] property #

Description of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.description
'A dummy description.'
>>>

dev_url: List[str] property #

A list of URLs to the development page of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.dev_url
['https://github.com/conda/rattler']
>>>

doc_url: List[str] property #

A list of URLs to the documentation of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.doc_url
['https://conda.github.io/rattler/py-rattler/']
>>>

home: List[str] property #

A list URL to the homepage of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.home
['http://github.com/conda/rattler']
>>>

license: Optional[str] property #

The license of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.license
'BSD-3-Clause'
>>>

license_family: Optional[str] property #

The license family of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.license_family
>>> type(about.license_family)
<class 'NoneType'>
>>>

source_url: Optional[str] property #

The URL to the latest source code of the package.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.source_url
'https://github.com/conda/rattler'
>>>

summary: Optional[str] property #

A Short summary description.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.summary
'A dummy summary.'
>>>

__repr__() #

Returns a representation of the AboutJson.

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

Parses the object from a file specified by a path, using a format appropriate for the file type.

For example, if the file is in JSON format, this function reads the data from the file at the specified path, parse the JSON string and return the resulting object. If the file is not in a parsable format or if the file could not read, this function returns an error.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about
AboutJson()
>>>

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.

Examples#
>>> import json
>>> with open("../test-data/dummy-about.json", 'r') as file:
...     json_str = json.dumps(json.load(file))
>>> about = AboutJson.from_str(json_str)
>>> about
AboutJson()
>>>

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.

Examples#
>>> AboutJson.package_path()
'info/about.json'
>>>