Skip to main content

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

pyeil-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyeil-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

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

Hashes for pyeil-0.1.0.tar.gz
Algorithm Hash digest
SHA256 459727a51750a3f8146c5f34898de3c54d81b0b1e445f8d03cde7983e89c1082
MD5 7cc9d9af860c3e45bbe66f7e0c284829
BLAKE2b-256 51d46a015aeb5a985f9ce74657cbc2f17c8609e0ce5e43d0fa8de3908111735e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyeil-0.1.0.tar.gz:

Publisher: ci.yml on evamaxfield/py-extract-imported-libraries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pyeil-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c12cd380a03153d3721b6b13f10a3cf0e7d3ef9e49287e60d433947fa85057d9
MD5 5f6f26dd4056b0d6c34c14b4f44d096d
BLAKE2b-256 0b99911e85e417b103a84fe48447d3fa0acf46e6791eb550cc7cc77025953d3c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page