{"id":23395953,"url":"https://github.com/matthewdeanmartin/so_pip","last_synced_at":"2025-04-11T14:13:22.414Z","repository":{"id":38038243,"uuid":"323120708","full_name":"matthewdeanmartin/so_pip","owner":"matthewdeanmartin","description":"Turn an answer on StackOverflow into a python package you can vendorize","archived":false,"fork":false,"pushed_at":"2025-02-19T08:35:16.000Z","size":810,"stargazers_count":5,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T06:47:18.705Z","etag":null,"topics":["packaging-python","pypi","python","stackoverflow","vendoring"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewdeanmartin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-20T16:55:35.000Z","updated_at":"2024-05-17T16:51:25.000Z","dependencies_parsed_at":"2024-07-16T10:25:54.458Z","dependency_job_id":null,"html_url":"https://github.com/matthewdeanmartin/so_pip","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Fso_pip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Fso_pip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Fso_pip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Fso_pip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewdeanmartin","download_url":"https://codeload.github.com/matthewdeanmartin/so_pip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248415039,"owners_count":21099593,"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":["packaging-python","pypi","python","stackoverflow","vendoring"],"created_at":"2024-12-22T07:19:45.330Z","updated_at":"2025-04-11T14:13:22.394Z","avatar_url":"https://github.com/matthewdeanmartin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"so_pip\n======\nEveryone copies code from StackOverflow, but no one is formalizing it.\n\n`so_pip` will vendorize the source code of question or answer into a folder and\ngenerate the files to make into a python package.\n\n`so_pip` is less like a package installer and more like a project template maker, [cookie cutter, vendorizing libraries\nand stackoverflow search cli's](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/prior_art.md).\n\n## so_pip is dead, the AI version might actually be useful\n\nEver think, \"I wish I could pip install the answer to this stackoverflow question?\"\nYou almost could with some markdown parsing and vendorizing techniques.\n\nBut too many answers were not given in the form of a function or a class, so they lack\nthe minimal conditions for code re-use. There is no non-AI way to turn a script into\na re-usable function, so this approach was always fatally flawed.\n\nSee the soon-to-be-posted \"ai_pip\" project that will do the same thing but use ChatGPT\nto transform the answer into re-usable code. This will solve previously unsolvable problems,\nlike:\n\n- What code is this? Is that python or bash?\n- Is this series of markdown blocks one code file per block?\n- Is this series of markdown code blocks actually one code file with comments?\n- What is a good name for the package?\n- Is the code in the question part of the code in the answer?\n- If this code was written to be re-usable, what would it look like?\n- How do we upgrade the code to modern python?\n- Is the code malicious or buggy?\n- Where are the tests?\n\nBadges\n------\n\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/so-pip)\n[![Downloads](https://pepy.tech/badge/so-pip/month)](https://pepy.tech/project/so-pip/month)\n[![CodeFactor](https://www.codefactor.io/repository/github/matthewdeanmartin/so_pip/badge)](https://www.codefactor.io/repository/github/matthewdeanmartin/so_pip)\n\nInstallation\n------------\nRequires Python 3.11+\n\n```\npip install so_pip\n# or\npoetry install so_pip\n\nso_pip vendorize my_name --question=31049648 --output=output\n```\n\nUsing via [dockerhub](https://hub.docker.com/repository/docker/matthewdeanmartin/so_pip)\n\n```\n# for mac, unix, cmd.exe, powershell\ndocker pull matthewdeanmartin/so_pip\ndocker run --rm -i -v \"$PWD/data:/data\" matthewdeanmartin/so_pip --help\n```\n\nIf you use git bash/mingw64/cygwin, see [run.sh](https://github.com/matthewdeanmartin/so_pip/blob/main/docker/run.sh)\nbecause docker needs help doing a volume mount.\n\n\nUsage\n--------------\nConsider getting a [key](https://stackapps.com/apps/oauth/register) and adding\na [.so_pip.ini file](https://github.com/matthewdeanmartin/so_pip/blob/main/.so_pip.ini) The app will make best efforts\nif you don't.\n\n```\n# Turn posts into nicely formated packages\n\u003e so_pip vendorize my_name --question=31049648 | --answer=31049648\n\u003e so_pip search --answer=31049648 --tags=python\n\n# Pip-like commands\n\u003e so_pip uninstall | upgrade {package_name}\n\u003e so_pip list | freeze\n```\n\nDocs\n-----\n\n* [Examples](https://github.com/matthewdeanmartin/so_pip/tree/main/examples)\n* [Workflows](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/workflows.md)\n* [CLI](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/cli.md)\n* [Code reuse scanarios you see on StackOverflow](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/scenarios.md)\n* [Features](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/features.md)\n* [Security Considerations](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/security.md)\n* [Prior Art](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/prior_art.md) Similar and overlapping tools.\n* [Contributing *answers* to StackOverflow](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/contributing.md)\n  AKA, fixing answers you found.\n* [Attribution Compliance](https://github.com/matthewdeanmartin/so_pip/blob/main/docs/comply_with_cc_sa.md)\n* [Contributing to so_pip](https://github.com/matthewdeanmartin/so_pip/blob/main/CONTRIBUTING.md)\n* [Code of Conduct for so_pip](https://github.com/matthewdeanmartin/so_pip/blob/main/CODE_OF_CONDUCT.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewdeanmartin%2Fso_pip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewdeanmartin%2Fso_pip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewdeanmartin%2Fso_pip/lists"}