Extract imported libraries from Python, R, and other source code files using tree-sitter.
Project description
Extract Imported Libraries
Small Python utility to extract imported libraries from source code files in various programming languages using tree-sitter.
Supported Languages
- Python
- R
Usage
from eil import Extractor
extractor = Extractor()
imported_libs = extractor.extract_from_file("path/to/your/file.py")
print(imported_libs)
For example, here are the imported libraries extracted from the main.py file itself:
from eil import Extractor
extractor = Extractor()
imported_libs = extractor.extract_from_file("main.py")
print(imported_libs)
# Output:
# ImportedLibraries(
# stdlib={'collections', 'pathlib', 'dataclasses', 'typing'},
# third_party={'tree_sitter_language_pack', 'tree_sitter'},
# first_party={'data'},
# )
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyeil-0.1.0.tar.gz.
File metadata
- Download URL: pyeil-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
459727a51750a3f8146c5f34898de3c54d81b0b1e445f8d03cde7983e89c1082
|
|
| MD5 |
7cc9d9af860c3e45bbe66f7e0c284829
|
|
| BLAKE2b-256 |
51d46a015aeb5a985f9ce74657cbc2f17c8609e0ce5e43d0fa8de3908111735e
|
Provenance
The following attestation bundles were made for pyeil-0.1.0.tar.gz:
Publisher:
ci.yml on evamaxfield/py-extract-imported-libraries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyeil-0.1.0.tar.gz -
Subject digest:
459727a51750a3f8146c5f34898de3c54d81b0b1e445f8d03cde7983e89c1082 - Sigstore transparency entry: 815093635
- Sigstore integration time:
-
Permalink:
evamaxfield/py-extract-imported-libraries@ce8bf89c32e1d6cdb3e3dad6caa1d35a8945bbe1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/evamaxfield
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ce8bf89c32e1d6cdb3e3dad6caa1d35a8945bbe1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyeil-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyeil-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c12cd380a03153d3721b6b13f10a3cf0e7d3ef9e49287e60d433947fa85057d9
|
|
| MD5 |
5f6f26dd4056b0d6c34c14b4f44d096d
|
|
| BLAKE2b-256 |
0b99911e85e417b103a84fe48447d3fa0acf46e6791eb550cc7cc77025953d3c
|
Provenance
The following attestation bundles were made for pyeil-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on evamaxfield/py-extract-imported-libraries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyeil-0.1.0-py3-none-any.whl -
Subject digest:
c12cd380a03153d3721b6b13f10a3cf0e7d3ef9e49287e60d433947fa85057d9 - Sigstore transparency entry: 815093640
- Sigstore integration time:
-
Permalink:
evamaxfield/py-extract-imported-libraries@ce8bf89c32e1d6cdb3e3dad6caa1d35a8945bbe1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/evamaxfield
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ce8bf89c32e1d6cdb3e3dad6caa1d35a8945bbe1 -
Trigger Event:
push
-
Statement type: