requirementslib.models.metadata module¶
-
class
requirementslib.models.metadata.Dependency(name: str, requirement: packaging.requirements.Requirement, specifier, extras=NOTHING, from_extras=None, python_version='', parent=None, markers=None, specset_str: str = '', python_version_str: str = '', marker_str: str = '')[source]¶ Bases:
object-
extras= None¶ Any extras this dependency declares
-
from_extras= None¶ The name of the extra meta-dependency this one came from (e.g. ‘security’)
-
markers= None¶ The markers for this dependency
-
name= None¶ The name of the dependency
-
parent= None¶ The parent of this dependency (i.e. where it came from)
-
python_version= None¶ The declared specifier set of allowable python versions for this dependency
-
requirement= None¶ A requirement instance
-
specifier= None¶ The specifier defined in the dependency definition
-
-
class
requirementslib.models.metadata.Digest(algorithm: str, value: str)[source]¶ Bases:
object-
algorithm= None¶ The algorithm declared for the digest, e.g. ‘sha256’
-
value= None¶ The digest value
-
-
class
requirementslib.models.metadata.ExtrasCollection(name: str, parent: Dependency, dependencies=NOTHING)[source]¶ Bases:
object-
dependencies= None¶ The members of the collection
-
name= None¶ The name of the extras collection (e.g. ‘security’)
-
parent= None¶ The dependency the collection belongs to
-
-
class
requirementslib.models.metadata.Package(info, last_serial: int, releases, urls=NOTHING)[source]¶ Bases:
object-
dependencies¶
-
latest_sdist¶
-
latest_wheels¶
-
name¶
-
requirement¶
-
version¶
-
-
class
requirementslib.models.metadata.PackageEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶ Bases:
json.encoder.JSONEncoder-
default(obj)[source]¶ Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
-
-
class
requirementslib.models.metadata.PackageInfo(name: str, version: str, package_url: str, summary: str = None, author: str = None, keywords=NOTHING, description: str = '', download_url: str = '', home_page: str = '', license: str = '', maintainer: str = '', maintainer_email: str = '', downloads=NOTHING, docs_url=None, platform: str = '', project_url: str = '', project_urls=NOTHING, requires_python=None, requires_dist=NOTHING, release_url=None, description_content_type: str = 'text/md', bugtrack_url=None, classifiers=NOTHING, author_email=None, markers=None, dependencies=None)[source]¶ Bases:
object-
create_dependencies(force=False)[source]¶ Create values for self.dependencies.
Parameters: force (bool) – Sets self.dependencies to an empty tuple if it would be None, defaults to False. Returns: An updated instance of the current object with self.dependencies updated accordingly. Return type: PackageInfo
-
-
class
requirementslib.models.metadata.ParsedTag(marker_string=None, python_version=None, platform_system=None, abi=None)[source]¶ Bases:
object-
abi= None¶ the ABI represented by the tag
-
marker_string= None¶ The marker string corresponding to the tag
-
platform_system= None¶ The platform represented by the tag
-
python_version= None¶ The python version represented by the tag
-
-
class
requirementslib.models.metadata.Release(version: str, urls, name=None)[source]¶ Bases:
collections.abc.Sequence-
latest¶
-
latest_timestamp¶
-
name= None¶ the name of the package
-
parsed_version¶
-
sdists¶
-
urls= None¶ The URL collection for the release
-
version= None¶ The version of the release
-
wheels¶
-
yanked¶
-
-
class
requirementslib.models.metadata.ReleaseCollection(releases=NOTHING)[source]¶ Bases:
object-
latest¶
-
non_yanked_releases¶
-
-
class
requirementslib.models.metadata.ReleaseUrl(md5_digest: requirementslib.models.metadata.Digest, packagetype: str, upload_time, upload_time_iso_8601, size: int, url: str, digests, name: str = None, comment_text: str = '', yanked: bool = False, downloads: int = -1, filename: str = '', has_sig: bool = False, python_version: str = 'source', requires_python: str = None, tags=NOTHING)[source]¶ Bases:
object-
comment_text= None¶ The available comments of the given upload
-
digests= None¶ The digests of the package
-
downloads= None¶ The number of downloads (deprecated)
-
filename= None¶ The filename of the current upload
-
has_sig= None¶ Whether the upload has a signature
-
is_sdist¶
-
is_wheel¶
-
markers¶
-
md5_digest= None¶ The MD5 digest of the given release
-
name= None¶ The name of the package
-
packagetype= None¶ The package type of the url
-
pep508_url¶
-
python_version= None¶ The python_version attribute of the upload (e.g. ‘source’, ‘py27’, etc)
-
requires_python= None¶ The ‘requires_python’ restriction on the package
-
sha256¶
-
size= None¶ The size in bytes of the package
A list of valid aprsed tags from the upload
-
upload_time= None¶ The upload timestamp from the package
-
upload_time_iso_8601= None¶ The ISO8601 formatted upload timestamp of the package
-
url= None¶ The URL of the package
-
yanked= None¶ Whether the url has been yanked from the server
-
-
class
requirementslib.models.metadata.ReleaseUrlCollection(urls, name=None)[source]¶ Bases:
collections.abc.Sequence-
find_package_type(type_)[source]¶ Given a package type (e.g. sdist, bdist_wheel), find the matching release.
Parameters: type (str) – A package type from PACKAGE_TYPESReturns: The package from this collection matching that type, if available Return type: Optional[ReleaseUrl]
-
latest¶
-
latest_timestamp¶
-
name= None¶ the name of the package
-
sdists¶
-
urls= None¶ A list of release URLs
-
wheels¶
-
-
requirementslib.models.metadata.instance_check_converter(expected_type=None, converter=None)[source]¶