{"id":20725616,"url":"https://github.com/nicolasmicaux/searchin","last_synced_at":"2025-04-23T18:09:15.222Z","repository":{"id":61698782,"uuid":"554236916","full_name":"NicolasMICAUX/searchin","owner":"NicolasMICAUX","description":"Search anything in a live python object/method/variable!","archived":false,"fork":false,"pushed_at":"2024-09-24T15:36:29.000Z","size":86,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T18:09:06.007Z","etag":null,"topics":["debug","debugging-tool","inspect","python","searching"],"latest_commit_sha":null,"homepage":"","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/NicolasMICAUX.png","metadata":{"files":{"readme":"README.fr.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":["NicolasMICAUX"]}},"created_at":"2022-10-19T13:29:41.000Z","updated_at":"2024-09-24T15:36:27.000Z","dependencies_parsed_at":"2024-11-17T04:20:11.457Z","dependency_job_id":"e9549b55-8e5a-4924-b93e-9ca70f7139b4","html_url":"https://github.com/NicolasMICAUX/searchin","commit_stats":{"total_commits":42,"total_committers":2,"mean_commits":21.0,"dds":"0.23809523809523814","last_synced_commit":"79d78accbc5544bb4a15e5acabfde4ce60f517a1"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasMICAUX%2Fsearchin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasMICAUX%2Fsearchin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasMICAUX%2Fsearchin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasMICAUX%2Fsearchin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicolasMICAUX","download_url":"https://codeload.github.com/NicolasMICAUX/searchin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250487531,"owners_count":21438612,"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":["debug","debugging-tool","inspect","python","searching"],"created_at":"2024-11-17T04:19:34.602Z","updated_at":"2025-04-23T18:09:15.215Z","avatar_url":"https://github.com/NicolasMICAUX.png","language":"Python","funding_links":["https://github.com/sponsors/NicolasMICAUX"],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n[![Contributors][contributors-shield]][contributors-url]\u003c!--[![Forks][forks-shield]][forks-url]--\u003e\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\u003c!--[![MIT License][license-shield]][license-url]--\u003e\u003c!--[![LinkedIn][linkedin-shield]][linkedin-url]--\u003e\n[![PyPi version][pypi-shield]][pypi-url]\n[![Python 2][python2-shield]][python-url]\n[![Python 3][python3-shield]][python-url]\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n\n  \u003ca href=\"https://github.com/NicolasMICAUX/searchin\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/NicolasMICAUX/searchin/main/images/logo.png\" alt=\"Logo\" width=\"160\" height=\"160\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eSearch'In\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\nCherchez ce que vous voulez dans un objet, méthode ou variable python, directement dans votre code !\n    \u003cbr /\u003e\n\u003c!--\n    \u003ca href=\"https://github.com/NicolasMICAUX/searchin\"\u003e\u003cstrong\u003eExplorer la documentation »\u003c/strong\u003e\u003c/a\u003e\n--\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/NicolasMICAUX/searchin\"\u003eVoir la démo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/NicolasMICAUX/searchin/issues\"\u003eReport Bug\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## Introduction\n\n\u003c!-- [Screen Shot][product-screenshot] --\u003e\n\nAvez vous déjà passé des heures à chercher le nom d'une méthode ou d'une propriété d'une librairie tierce ? Vous êtes sûr que cette méthode/propriété doit exister, mais impossible de la trouver, ni dans la documentation, ni dans les exemples, ni sur StackOverflow... Vous finissez par vous résigner à scroller dans le code source de la librairie... Tellement frustrant !\n\nSearch'In est un outil qui vous permet de rechercher dans des objets python comme si vous étiez sur Google, juste en ajoutant une ligne en plein milieu de votre code !\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eretour en haut\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n## Pour commencer\nUtiliser Search'In ne recquiert aucun effort.\n\nInstaller Search'In avec pip :\n```sh\npip install searchin\n```\n\nImporter Search'In dans votre code, en ajoutant cette ligne :\n```python\nimport searchin\n```\n\nPour chercher `\"name\"` dans une classe `Human` par exemple, il suffit d'ajouter cette ligne :\n```python\nsearchin(Human, \"name\")\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## D'autres exemples\nVous pouvez chercher n'importe quelle chaîne de caractère dans n'importe quel \"entité\" python : variable, méthode, objet, classe, module, etc.\n\n**Chercher `\"5\"` dans un `tuple`**\n```python\nsearchin((1, 2, 3, 4, 5, 6, 7, 8, 9), \"5\")\n# \u003e\u003e\u003e \"5\" found in root.4 : 5\n```\n\n**Chercher `\"mean\"` dans la méthode `torch.nn.functional.cross_entropy`**\n```python\nsearchin(torch.nn.functional.cross_entropy, \"mean\")\n# \u003e\u003e\u003e \"mean\" found in root. : def cross_entropy( [...] reduction: str = \"mean\", [...], label_smoothing)\n```\n\n**Chercher `\"grad\"` dans un `torch.nn.Module`**\n```python\nmodel = torch.nn.Linear(10, 10)\nsearchin(model, \"grad\")\n# \u003e\u003e\u003e \"grad\" found in root.bias\n# \u003e\u003e\u003e \"grad\" found in root.requires_grad_\n# \u003e\u003e\u003e \"grad\" found in root.weight\n# \u003e\u003e\u003e \"grad\" found in root.zero_grad\n```\n\n## Fonctionnalités avancées\n```python\ndef searchin(obj,\n             query: str,\n             max_depth: int = 3,\n             top_k_results: int = 10,\n             max_iterable_length: int = 100,\n             get_raw_result: bool = False) -\u003e Union[List[SearchResult], None]:\n    \"\"\"\n    Search an object for a given search term.\n    :param obj: The object to search in.\n    :param query: What to search for.\n    :param max_depth: The maximum depth of the recursive search.\n    :param top_k_results: The maximum number of results to return.\n    :param max_iterable_length: The maximum length of an iterable to search in.\n    :param get_raw_result: If True, return the raw results (of type SearchResult), else just print them.\n    :return: A list of search results.\n    \"\"\"\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n_(Section in english)_  \nI want to add a lot of functionnalities to this project, but I don't have much time to work on it. Contributions are welcome!  \n\n\u003c!-- ROADMAP--\u003e\n### Roadmap/todo\n\u003c!-- table with columns : task, importance, difficulty, status, description --\u003e\n| Task                     | Importance | Difficulty | Contributor on it | Description                                                                                                                                    |\n|:-------------------------|------------|------------|-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [Fuzzy match](https://github.com/NicolasMICAUX/searchin/discussions/2)              | 5/5        | 2/5        | NOBODY            | _e.g._ : `batch_size` should match when searching `batchsize`.                                                                                 |\n| [Underline the match](https://github.com/NicolasMICAUX/searchin/discussions/4)      | 4/5        | 1/5        | NOBODY            | _e.g._ : the printed result should be formatted like this : _def cross_entropy( [...] reduction: str = \"\u003cu\u003emean\u003c/u\u003e\", [...], label_smoothing)_ |\n| [Write some tests](https://github.com/NicolasMICAUX/searchin/discussions/5)         | 4/5        | 2/5        | NOBODY            | Write some tests to ensure that the code is working properly.                                                                                  |\n| [Find a better algorithm](https://github.com/NicolasMICAUX/searchin/discussions/7)  | 3/5        | 4/5        | NOBODY            | The current algorithm is a BFS (Breadth First Search). Maybe there is a better algorithm to use.                                               |\n| [`Searchin...` animation](https://github.com/NicolasMICAUX/searchin/discussions/9)  | 3/5        | 1/5        | NOBODY            | Add a cool animation when searching takes a bit of time.                                                                                       |\n| [Profile code](https://github.com/NicolasMICAUX/searchin/discussions/11)             | 2/5        | 1/5        | NOBODY            | Profile the code to see if we can speed it up a little.                                                                                        |\n| [Add a CLI](https://github.com/NicolasMICAUX/searchin/discussions/12)                | 1/5        | 2/5        | NOBODY            | Think about the design of a CLI (Command Line Interface) to use Search'In from the terminal.                                                   |\n\nNon-Code contribution :\n\n| Task                     | Importance | Difficulty | Contributor on it | Description                                                                                                                                                           |\n|:-------------------------|------------|------------|-------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Adding documentation](https://github.com/NicolasMICAUX/searchin/discussions/6)     | 4/5        | 1/5        | NOBODY            | Add some helpful docstrings, write basic tutorials with real-life scenarios, write a wiki for other contributors to better understand the functioning of the library. |\n\n\n_For every todo, just click on the link to find the discussion where I describe how I would do it._  \nSee the [open issues](https://github.com/NicolasMICAUX/searchin/issues) for a full list of proposed features (and known issues).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### How to contribute\nContributing is an awesome way to learn, inspire, and help others. Any contributions you make are **greatly appreciated**, even if it's just about styling and best practices.\n\nIf you have a suggestion that would make this project better, please fork the repo and create a pull request.  \nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/YourAmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n## Auteurs\nCette librairie a été crée par [Nicolas MICAUX](https://github.com/NicolasMICAUX).\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/NicolasMICAUX/searchin.svg?style=for-the-badge\n[contributors-url]: https://github.com/NicolasMICAUX/searchin/graphs/contributors\n[stars-shield]: https://img.shields.io/github/stars/NicolasMICAUX/searchin.svg?style=for-the-badge\n[stars-url]: https://github.com/NicolasMICAUX/searchin/stargazers\n[issues-shield]: https://img.shields.io/github/issues/NicolasMICAUX/searchin.svg?style=for-the-badge\n[issues-url]: https://github.com/NicolasMICAUX/searchin/issues\n[pypi-shield]: https://img.shields.io/pypi/v/searchin.svg?style=for-the-badge\n[pypi-url]: https://pypi.org/project/searchin/\n[python2-shield]: https://img.shields.io/badge/python-2.7+-blue.svg?style=for-the-badge\n[python3-shield]: https://img.shields.io/badge/python-3.5+-blue.svg?style=for-the-badge\n[python-url]: https://www.python.org/downloads/\n\n[//]: # ([license-shield]: https://img.shields.io/github/license/NicolasMICAUX/searchin.svg?style=for-the-badge)\n[//]: # ([license-url]: https://github.com/NicolasMICAUX/searchin/blob/master/LICENSE.txt)\n[//]: # ([linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555)\n[//]: # ([linkedin-url]: https://linkedin.com/in/othneildrew)\n[product-screenshot]: images/screenshot.png\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolasmicaux%2Fsearchin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolasmicaux%2Fsearchin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolasmicaux%2Fsearchin/lists"}