Skip to content

AboutJson#

AboutJson #

The about.json file contains metadata about the package.

channels: List[str] property writable #

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']
>>> about.channels = ['https://test.channel']
>>> about.channels
['https://test.channel']
>>>

description: Optional[str] property writable #

Description of the package.

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

dev_url: List[str] property writable #

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']
>>> about.dev_url = ['https://test.dev']
>>> about.dev_url
['https://test.dev/']
>>>

doc_url: List[str] property writable #

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/']
>>> about.doc_url = ['https://test.docs']
>>> about.doc_url
['https://test.docs/']
>>>

home: List[str] property writable #

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']
>>> about.home = ['https://test.home']
>>> about.home
['https://test.home/']
>>>

license: Optional[str] property writable #

The license of the package.

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

license_family: Optional[str] property writable #

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'>
>>> about.license_family = 'BSD'
>>> about.license_family
'BSD'
>>>

source_url: Optional[str] property writable #

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'
>>> about.source_url = 'https://test.source'
>>> about.source_url
'https://test.source/'
>>>

summary: Optional[str] property writable #

A Short summary description.

Examples#
>>> about = AboutJson.from_path("../test-data/dummy-about.json")
>>> about.summary
'A dummy summary.'
>>> about.summary = 'New summary'
>>> about.summary
'New 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'
>>>