{"id":16195178,"url":"https://github.com/bdice/nb-strip-paths","last_synced_at":"2025-04-07T15:54:15.700Z","repository":{"id":70397221,"uuid":"337537642","full_name":"bdice/nb-strip-paths","owner":"bdice","description":"Parse Jupyter notebook cell outputs and replace user paths \"/home/user/...\" with links relative to the project root.","archived":false,"fork":false,"pushed_at":"2021-02-26T19:03:06.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-13T18:35:23.504Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bdice.png","metadata":{"files":{"readme":"README.md","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":"2021-02-09T21:11:58.000Z","updated_at":"2021-02-26T19:03:08.000Z","dependencies_parsed_at":"2023-02-24T11:45:21.199Z","dependency_job_id":null,"html_url":"https://github.com/bdice/nb-strip-paths","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/bdice%2Fnb-strip-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdice%2Fnb-strip-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdice%2Fnb-strip-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdice%2Fnb-strip-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdice","download_url":"https://codeload.github.com/bdice/nb-strip-paths/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685594,"owners_count":20979084,"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-10T08:26:31.747Z","updated_at":"2025-04-07T15:54:15.678Z","avatar_url":"https://github.com/bdice.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nb-strip-paths\n\nThis is a pre-commit hook that strips user paths from Jupyter notebooks. For example:\n\n```\n# When executing from a repository \"my_awesome_code\"\n/home/bdice/my_awesome_code/some_directory/file.txt\n# becomes...\nsome_directory/file.txt\n```\n\nThis makes cleaner (and safer) examples for projects with tutorials that deal with filesystems and must print absolute paths.\nCreated for use with [signac-examples](https://github.com/glotzerlab/signac-examples).\n\nMuch of this project's code is copied from *nbqa* under the MIT license. [nbqa](https://github.com/nbQA-dev/nbQA/tree/master/nbqa) is a wonderful tool for using Python linters/formatters with Jupyter notebooks, and I strongly recommend trying it!\n\n## Usage\n\nAdd this snippet to `.pre-commit-config.yaml`:\n\n```yaml\n  - repo: https://github.com/bdice/nb-strip-paths\n    rev: 'v0.1.0'\n    hooks:\n      - id: nb-strip-paths\n```\n\n## Tests\n\nThe tests require [nbconvert](https://github.com/jupyter/nbconvert) and [nbstripout](https://github.com/kynan/nbstripout).\n\nFor now, there is only a regression test. The output must be verified manually for correctness if committing changes to the test file.\n\nTo run the tests, execute:\n\n```bash\ncd tests\n./run_tests.sh\n```\n\nIf the test notebook is updated, execute:\n\n```bash\ncd tests\n./generate_reference_notebooks.sh\n```\n\nand verify the notebook looks correct before committing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdice%2Fnb-strip-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdice%2Fnb-strip-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdice%2Fnb-strip-paths/lists"}