# python-third-party-imports
This is a **Python** **CLI** tool built with **Rust** that finds all third-party packages imported into your Python project.
# Install
You can install this package via pip.
```console
pip install third-party-imports
```
# Usage
### Run:
**Check a directory:**
```console
third-party-imports path/to/project/dir
```
**Check a directory with extra files:**
```console
third-party-imports --extra-file-paths path/to/project/dir/foo.sh path/to/project/dir
```
**Note:** You can use `--extra-file-paths` option to include files that do not contain `.py` or `.pyi` extension.
**Check a file:**
```console
third-party-imports --project-root path/to/project/dir/ path/to/project/dir/foo/main.py
```
**Note:** If the file is not located in the project root directory,
then you need to use `--project-root` option to specify where the project root directory is located.
### Help:
```console
Find all third-party packages imported into your python project.
Usage: third-party-imports [OPTIONS] <PATH>
Arguments:
<PATH> Path to a file or directory to check
Options:
-p, --project-root <PROJECT_ROOT> Path to the project's root directory
-e, --extra-file-paths <EXTRA_FILE_PATHS> Extra file paths to check
-h, --help Print help
-V, --version Print version
```
# Example
```console
third-party-imports examples/
```
**Output:**
```console
Found '4' third-party package imports in '5' files. (Took 920.50µs)
celery
django
pandas
requests
```
# Development
### Run using Cargo
```console
cargo +nightly run -- path/to/project/dir
```
### Code Format
```console
cargo +nightly fmt
```
### Run Tests
```console
cargo +nightly test
```
### Install Package in current `virtualenv`
```console
maturin develop
```
# License
The code in this project is released under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/saadmk11/python-third-party-imports",
"name": "third-party-imports",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "Maksudul Haque <saad.mk112@gmail.com>",
"keywords": "import,finder",
"author": "Maksudul Haque <saad.mk112@gmail.com>",
"author_email": "Maksudul Haque <saad.mk112@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6f/db/113d2211abcd36b6b586287b9c5b0ed0d525a083a0979efb37e1fbe5788e/third_party_imports-0.0.7.tar.gz",
"platform": null,
"description": "# python-third-party-imports\n\nThis is a **Python** **CLI** tool built with **Rust** that finds all third-party packages imported into your Python project.\n\n# Install\n\nYou can install this package via pip.\n\n```console\npip install third-party-imports\n```\n\n# Usage\n\n### Run:\n\n**Check a directory:**\n\n```console\nthird-party-imports path/to/project/dir\n```\n\n**Check a directory with extra files:**\n\n```console\nthird-party-imports --extra-file-paths path/to/project/dir/foo.sh path/to/project/dir\n```\n\n**Note:** You can use `--extra-file-paths` option to include files that do not contain `.py` or `.pyi` extension.\n\n\n**Check a file:**\n\n```console\nthird-party-imports --project-root path/to/project/dir/ path/to/project/dir/foo/main.py\n```\n\n**Note:** If the file is not located in the project root directory,\nthen you need to use `--project-root` option to specify where the project root directory is located.\n\n### Help:\n\n```console\nFind all third-party packages imported into your python project.\n\nUsage: third-party-imports [OPTIONS] <PATH>\n\nArguments:\n <PATH> Path to a file or directory to check\n\nOptions:\n -p, --project-root <PROJECT_ROOT> Path to the project's root directory\n -e, --extra-file-paths <EXTRA_FILE_PATHS> Extra file paths to check\n -h, --help Print help\n -V, --version Print version\n```\n\n# Example\n\n```console\nthird-party-imports examples/\n```\n\n**Output:**\n\n```console\nFound '4' third-party package imports in '5' files. (Took 920.50\u00b5s)\n\ncelery\ndjango\npandas\nrequests\n```\n\n# Development\n\n### Run using Cargo\n\n```console\ncargo +nightly run -- path/to/project/dir\n```\n\n### Code Format\n\n```console\ncargo +nightly fmt\n```\n\n### Run Tests\n\n```console\ncargo +nightly test\n```\n\n### Install Package in current `virtualenv`\n\n```console\nmaturin develop\n```\n\n# License\n\nThe code in this project is released under the [MIT License](LICENSE).\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Find all third-party packages imported into your python project.",
"version": "0.0.7",
"split_keywords": [
"import",
"finder"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6d1585ebbbb69a3121b9cae6403f5b6e221dea3863a4a892d3087726acb1d1b4",
"md5": "96aa3f7c0d394946b33fc6787e4850fd",
"sha256": "6ca8ecf5e65f816beea39232fad537f93a34654da9a0ebfc89aea77c0bf5dc23"
},
"downloads": -1,
"filename": "third_party_imports-0.0.7-py3-none-macosx_10_7_x86_64.whl",
"has_sig": false,
"md5_digest": "96aa3f7c0d394946b33fc6787e4850fd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 1088634,
"upload_time": "2023-01-31T15:33:04",
"upload_time_iso_8601": "2023-01-31T15:33:04.595493Z",
"url": "https://files.pythonhosted.org/packages/6d/15/85ebbbb69a3121b9cae6403f5b6e221dea3863a4a892d3087726acb1d1b4/third_party_imports-0.0.7-py3-none-macosx_10_7_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6f2f6bc32e2218b54b30e8624526204f11bb2e223e79b0b9aa87a46dfd0e0dab",
"md5": "d41ec0ca367a329e30a94d27dbad88ae",
"sha256": "8e8fce859dd57edc6f8dc00514505138cef4f93726b6b72bb5865c3f4aa70b97"
},
"downloads": -1,
"filename": "third_party_imports-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "d41ec0ca367a329e30a94d27dbad88ae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 1024326,
"upload_time": "2023-01-31T15:33:05",
"upload_time_iso_8601": "2023-01-31T15:33:05.928000Z",
"url": "https://files.pythonhosted.org/packages/6f/2f/6bc32e2218b54b30e8624526204f11bb2e223e79b0b9aa87a46dfd0e0dab/third_party_imports-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8251c369e227d9d38d6c7fd4229d682b445a47c274c66fee05d995b4a466bf71",
"md5": "b9dc6139c643d66716546802b5350b3c",
"sha256": "35e2ea9f7caee8b3225174edda48edd7baf73bd81b708e7d12a9e27d459ecd83"
},
"downloads": -1,
"filename": "third_party_imports-0.0.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "b9dc6139c643d66716546802b5350b3c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 1154013,
"upload_time": "2023-01-31T15:33:07",
"upload_time_iso_8601": "2023-01-31T15:33:07.494234Z",
"url": "https://files.pythonhosted.org/packages/82/51/c369e227d9d38d6c7fd4229d682b445a47c274c66fee05d995b4a466bf71/third_party_imports-0.0.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6744539f0405f9918da35d8050913f267b5711b7f45890d90ce06a8a72b1d3cd",
"md5": "af715d071e1e477d4da4707acc4b61e9",
"sha256": "c0be1449ba5758d2e488d6b422635c207e9bce594a56bf5f48ccadbf7e50f21c"
},
"downloads": -1,
"filename": "third_party_imports-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "af715d071e1e477d4da4707acc4b61e9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 1080168,
"upload_time": "2023-01-31T15:33:08",
"upload_time_iso_8601": "2023-01-31T15:33:08.588578Z",
"url": "https://files.pythonhosted.org/packages/67/44/539f0405f9918da35d8050913f267b5711b7f45890d90ce06a8a72b1d3cd/third_party_imports-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "94d4ca916af79331efd92158432bc0b9ed12c6dd75587ebeada0eaad11df5ac3",
"md5": "5eb591919239b64d0a386a2e0bdf4949",
"sha256": "1b127fb190c00d07135eaf8b8131ade91c30b34fbd20b0833d5b953ccdd02371"
},
"downloads": -1,
"filename": "third_party_imports-0.0.7-py3-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "5eb591919239b64d0a386a2e0bdf4949",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 1007992,
"upload_time": "2023-01-31T15:33:10",
"upload_time_iso_8601": "2023-01-31T15:33:10.210780Z",
"url": "https://files.pythonhosted.org/packages/94/d4/ca916af79331efd92158432bc0b9ed12c6dd75587ebeada0eaad11df5ac3/third_party_imports-0.0.7-py3-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6fdb113d2211abcd36b6b586287b9c5b0ed0d525a083a0979efb37e1fbe5788e",
"md5": "08f4b2f02c5aa323cda7699d7c9f0306",
"sha256": "e76808defaefb948130bd9dbf8ce21aecd8059ada898797c1fb5dc08e4c16435"
},
"downloads": -1,
"filename": "third_party_imports-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "08f4b2f02c5aa323cda7699d7c9f0306",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 17556,
"upload_time": "2023-01-31T15:33:11",
"upload_time_iso_8601": "2023-01-31T15:33:11.793717Z",
"url": "https://files.pythonhosted.org/packages/6f/db/113d2211abcd36b6b586287b9c5b0ed0d525a083a0979efb37e1fbe5788e/third_party_imports-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-31 15:33:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "saadmk11",
"github_project": "python-third-party-imports",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "third-party-imports"
}