{"id":22574817,"url":"https://github.com/thoth-station/invectio","last_synced_at":"2025-04-10T16:10:24.884Z","repository":{"id":35020897,"uuid":"185096739","full_name":"thoth-station/invectio","owner":"thoth-station","description":"Statically analyze sources and extract information about called or exported library functions in Python applications","archived":false,"fork":false,"pushed_at":"2024-04-25T05:21:46.000Z","size":300,"stargazers_count":20,"open_issues_count":2,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-25T18:24:03.380Z","etag":null,"topics":["artificial-intelligence","hacktoberfest","thoth"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thoth-station.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-06T00:12:37.000Z","updated_at":"2024-06-19T01:35:03.591Z","dependencies_parsed_at":"2023-01-15T12:10:20.467Z","dependency_job_id":"bc01019a-ea22-4fc8-9b6d-a5a565391dcf","html_url":"https://github.com/thoth-station/invectio","commit_stats":{"total_commits":134,"total_committers":17,"mean_commits":7.882352941176471,"dds":0.6865671641791045,"last_synced_commit":"28c73d5d5191bb6a4be539816be9830faae07be5"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Finvectio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Finvectio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Finvectio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Finvectio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoth-station","download_url":"https://codeload.github.com/thoth-station/invectio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250757,"owners_count":21072683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","hacktoberfest","thoth"],"created_at":"2024-12-08T03:08:04.999Z","updated_at":"2025-04-10T16:10:24.867Z","avatar_url":"https://github.com/thoth-station.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Invectio\n--------\n\nA simple tool to gather symbols provided or library calls and attribute usage\nbased on static analysis of sources of Python applications.\n\nSee `the linked article describing this\ntool \u003chttps://developers.redhat.com/articles/2022/01/05/extracting-information-python-source-code\u003e`__.\n\n\nInstallation\n============\n\nInvectio can be installed from `PyPI \u003chttps://pypi.org/project/invectio\u003e`_ using:\n\n.. code-block:: console\n\n  $ pip3 install invectio\n  $ invectio --help\n\n\nUsage\n=====\n\nYou can use this library as a CLI tool or as a Python module:\n\n.. code-block:: console\n\n  invectio whatprovides project-dir/   # To scan all Python files recursively for symbols provided.\n  invectio whatprovides app.py         # To perform symbols gathering on app.py file.\n\n  invectio whatuses project-dir/       # To scan all Python files recursively for symbols used from libraries.\n  invectio whatuses app.py             # To perform gather symbols used from libraries on app.py file.\n\n\n.. code-block:: python\n\n  from invectio import gather_library_usage\n  from invectio import gather_symbols_provided\n\n  result: dict = gather_library_usage(\"project-dir\")\n  result: dict = gather_library_usage(\"app.py\")\n\n  result: dict = gather_symbols_provided(\"project-dir\")\n  result: dict = gather_symbols_provided(\"app.py\")\n\n\nLimitations\n###########\n\nAs Python is a dynamic programming language, it's not possible to obtain all\nlibrary functions/attributes usage simply by performing static analysis of\nsources. One can still perfom \"crazy\" things like:\n\n\n.. code-block:: python\n\n  import tensorflow\n\n  getattr(tensorflow, \"const\" + \"ant\")(\"Hello, Invectio\")\n\n\nThis library does its best to detect all function/attributes being used inside\nPython sources, but usage like shown above cannot be detected simply by static\nanalysis of source code.\n\n\nDevelopment\n===========\n\nTo create a dev environment, clone the invectio repo and install all the dependencies:\n\n.. code-block:: console\n\n  git clone https://github.com/thoth-station/invectio \u0026\u0026 cd invectio\n  pipenv install --dev\n\nTo perform checks against unit tests present in the `tests/` directory,\nissue the following command from the root of the git repo:\n\n.. code-block:: console\n\n  pipenv run python3 setup.py test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Finvectio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoth-station%2Finvectio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Finvectio/lists"}