{"id":18405771,"url":"https://github.com/pybites-open-source/pysource","last_synced_at":"2025-07-20T14:03:28.192Z","repository":{"id":55640883,"uuid":"321579098","full_name":"PyBites-Open-Source/pysource","owner":"PyBites-Open-Source","description":"A command line tool to read Python source code.","archived":false,"fork":false,"pushed_at":"2021-11-05T07:23:01.000Z","size":19,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T10:08:41.587Z","etag":null,"topics":["hacktoberfest"],"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/PyBites-Open-Source.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-15T06:52:15.000Z","updated_at":"2025-06-12T13:23:34.000Z","dependencies_parsed_at":"2022-08-15T05:20:10.754Z","dependency_job_id":null,"html_url":"https://github.com/PyBites-Open-Source/pysource","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PyBites-Open-Source/pysource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyBites-Open-Source%2Fpysource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyBites-Open-Source%2Fpysource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyBites-Open-Source%2Fpysource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyBites-Open-Source%2Fpysource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyBites-Open-Source","download_url":"https://codeload.github.com/PyBites-Open-Source/pysource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyBites-Open-Source%2Fpysource/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135682,"owners_count":23881802,"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":["hacktoberfest"],"created_at":"2024-11-06T03:04:42.717Z","updated_at":"2025-07-20T14:03:28.151Z","avatar_url":"https://github.com/PyBites-Open-Source.png","language":"Python","readme":"# PyBites Pysource\n\nA command line tool to read Python source code.\n\n_Update 5th of Nov 2021_: we did not know it at the time, but this actually can be accomplished by Python's `inspect` module! So you might want to use that over this tool, for more info see [this Twitter thread](https://twitter.com/bbelderbos/status/1456234396810362885).\n\n\n## Installation\n\nYou can install `pybites-pysource` from [PyPI](https://pypi.org/project/pybites-pysource/):\n\n    pip install pybites-pysource\n\nOr use `pipx` if you want to have it available globally.\n\nThis tool uses Python 3.x\n\n## Usage\n\nYou can use `pybites-pysource`:\n\n```\n$ pysource -m re.match\ndef match(pattern, string, flags=0):\n\t\"\"\"Try to apply the pattern at the start of the string, returning\n\ta Match object, or None if no match was found.\"\"\"\n\treturn _compile(pattern, flags).match(string)\n```\n\nTo show the resulting code with paging add `-p` to the `pysource` command, so in this case: `pysource -m re.match -p`.\n\nCheck out [our blog post](https://pybit.es/get-python-source.html) for a demo.\n\n### Vim integration\n\nIf you want to dump `pysource`'s output to a vertical split window I recommend installing [`ConqueTerm`](https://github.com/gingerhot/conque-term-vim) and then add this to your `.vimrc`:\n\n```\nnmap \u003cleader\u003es :ConqueTermVSplit pysource -m \u003cC-R\u003e\u003cC-A\u003e\u003cCR\u003e\n```\n\nNow if you hit `\u003cleader\u003es` (`,s` in my case as my Vim _leader_ key is `,`) on any object, it will open a split window with the source code (if it can be found, otherwise you will see a `ModuleNotFoundError`).\n\n## Tests\n\nTo run the tests:\n\n\t$ python setup.py test\n\nSee: [Integrating with setuptools / python setup.py test / pytest-runner](https://docs.pytest.org/en/documentation-restructure/background/goodpractices.html#integrating-with-setuptools-python-setup-py-test-pytest-runner).\n\n---\n\nEnjoy!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybites-open-source%2Fpysource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpybites-open-source%2Fpysource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybites-open-source%2Fpysource/lists"}