{"id":16284398,"url":"https://github.com/takluyver/importtracer","last_synced_at":"2025-04-09T00:05:06.146Z","repository":{"id":66038536,"uuid":"21184296","full_name":"takluyver/importtracer","owner":"takluyver","description":"Track Python imports","archived":false,"fork":false,"pushed_at":"2014-10-16T18:36:12.000Z","size":156,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T18:48:54.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takluyver.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-24T23:40:08.000Z","updated_at":"2018-04-08T17:45:48.000Z","dependencies_parsed_at":"2023-02-19T21:35:20.565Z","dependency_job_id":null,"html_url":"https://github.com/takluyver/importtracer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takluyver%2Fimporttracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takluyver%2Fimporttracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takluyver%2Fimporttracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takluyver%2Fimporttracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takluyver","download_url":"https://codeload.github.com/takluyver/importtracer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947859,"owners_count":21023066,"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":[],"created_at":"2024-10-10T19:19:25.896Z","updated_at":"2025-04-09T00:05:06.005Z","avatar_url":"https://github.com/takluyver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Trace Python imports\n\nCommand line usage::\n\n    python3 importtracer.py [--csv file.csv] [--networkx] [-x pkg [-x ...]] module\n\nThis will import ``module``, tracking everything that gets imported. Passing\n``--csv`` will dump the results as a CSV file. ``--networkx`` will draw the\ngraph of imports using `NetworkX \u003chttps://networkx.github.io/\u003e`_. ``-x`` options\nwill exclude packages from the reporting by prefix (the data is still collected,\nbut not displayed).\n\nPython usage:\n\n.. code:: python\n\n    import importtracer\n    \n    with importtracer.track(excludes=['numpy']) as it:\n        import matplotlib\n    \n    # The imports made, as (modulename, importedby, time), filtering exclusions\n    it.filtered_links\n\n    # Save these as CSV:\n    it.dump_csv('file.csv')\n\n    # Make a NetworkX graph\n    g = it.dump_nx_graph()\n    # Draw the graph\n    networkx.draw(g); plt.show()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakluyver%2Fimporttracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakluyver%2Fimporttracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakluyver%2Fimporttracer/lists"}