Skip to main content

PyPI Python Version License Read the documentation at https://package-locator.readthedocs.io/ Build Package Status Run Tests Status Codecov pre-commit Black

Features

  • For a given package, package-locator locates its source code repository and the sub-directory within the repository the package resides in.

  • Covers packages from npm, PyPI, RubyGems, Composer, and Cargo.

  • Locates repository from metadata collected from registry APIs.

  • Validates repository and locates sub-directory through a set of heuristics for each package ecosystem. For npm, Composer, and Cargo packages, package-locator looks at the manifest file (package.json, composer.json, and Cargo.toml) to locate package specific code. For RubyGems and PyPI packages, package-locator either looks at the manifest file (gemspec file) or compares the files present in the registry with the files present in the repository.

Installation

You can install package-locator via pip from PyPI:

$ pip install package-locator

Usage

from package_locator.locator import get_repository_url_and_subdir is the primary function offered by package-locator. The function takes two inputs - ecosystem and package. The ecosystem names need to be provided as per defined within package-locator. You can import from package-locator.common import CARGO, NPM, PYPI, COMPOSER, RUBYGEMS and then use the constant values to indicate the ecosystem name. The function returns the source code repository URL and the sub-directory within the repository where the input package resides in. For example, get_repository_url_and_subdir(NPM, "react") call returns ("https://github.com/facebook/react", "./packages/react").

Credits

This package was created with cookietemple using Cookiecutter based on Hypermodern_Python_Cookiecutter.

Release files for package-locator 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for package-locator 0.4.4
File Size Uploaded
package-locator-0.4.4.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for package-locator 0.4.4
File Interpreter ABI Platform
package_locator-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 19.5 kB

Release files / package-locator-0.4.4.tar.gz

Download URL package-locator-0.4.4.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dc335c87def57d89c370547c49aa5aa8fcd256ba645520e5a5c15d3a27515b22
BLAKE2b-256 checksum
How to use checksums
13baf4f34faf835bdb6410b946f6c7770a4b5371ed032a45c10355c2fd5e90d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.10 Darwin/21.1.0

Release files / package_locator-0.4.4-py3-none-any.whl

Download URL package_locator-0.4.4-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4130b888edbe4a78086d1afb7befa2436f3a1b96753848606a79c1072f5bfb4d
BLAKE2b-256 checksum
How to use checksums
776b111c7a3370daeb7105b3adbf02c30aefa53b1d647f9461de754b0cfc4d1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.10 Darwin/21.1.0

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page