{"id":15014827,"url":"https://github.com/fallibleinc/pysession","last_synced_at":"2025-04-09T19:23:16.842Z","repository":{"id":62583451,"uuid":"68078829","full_name":"FallibleInc/pysession","owner":"FallibleInc","description":"Automatically saves python shell code to a local file or secret Gist","archived":false,"fork":false,"pushed_at":"2016-09-16T11:14:48.000Z","size":1083,"stargazers_count":86,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T22:47:48.288Z","etag":null,"topics":["gist","ipython","python","terminal"],"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/FallibleInc.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":"2016-09-13T05:57:15.000Z","updated_at":"2024-05-08T19:22:55.000Z","dependencies_parsed_at":"2022-11-03T21:22:44.633Z","dependency_job_id":null,"html_url":"https://github.com/FallibleInc/pysession","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FallibleInc%2Fpysession","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FallibleInc%2Fpysession/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FallibleInc%2Fpysession/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FallibleInc%2Fpysession/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FallibleInc","download_url":"https://codeload.github.com/FallibleInc/pysession/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248095890,"owners_count":21046936,"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":["gist","ipython","python","terminal"],"created_at":"2024-09-24T19:46:08.922Z","updated_at":"2025-04-09T19:23:16.814Z","avatar_url":"https://github.com/FallibleInc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Pysession\n\nAutomatically save python interpreter code to a file or secret Gist. You can turn this off for any session. Helpful when you want to share a piece of code you just hacked on the shell or wanted to save it in a file for use later. \n\nTested with IPython, Python2 \u0026 Python3 default shells.\n\n![Pysession demo](./pysession_demo.gif)\n\n#### Installation steps\n\n``` bash\npip install pysession\necho 'export PYTHONSTARTUP=$HOME/.pysession/pysession.py' \u003e\u003e ~/.bashrc\n```\n\nIf you are using zsh replace `.bashrc` in the above line with `.zshrc` and similarly for any other shell. On macOS, you should append this to `~/.bash_profile`\n\n#### How to use\n\nBy default, Pysession will record each shell run and save to a Gist. However it can be instructed to turn off recording or save to a file locally instead of GitHub.\n\n##### To turn off saving for a session\n\n``` python\n\u003e\u003e\u003e PySession.off()\n```\n\nAlternatively, to persist your choice of not saving sessions for some extended period of time, set an environment variable PYSESSION_SAVE_OFF to True. \n`export PYSESSION_SAVE_OFF=True`\n\n\n##### To turn back on saving for a session\n\n``` python\n\u003e\u003e\u003e PySession.on()\n```\n\n\n##### To save to a local file instead of Gist\n\n``` python\n\u003e\u003e\u003e PySession.local()\n```\n\nTo always save your sessions to local file, set an environment variable PYSESSION_SAVE_LOCALLY to True. \n`export PYSESSION_SAVE_LOCALLY=True`\n\nThe file is saved with a name `session.py` You can change this by setting the environment variable PYSESSION_FILENAME to your desired filename. \n`export PYSESSION_FILENAME=some_file_name.py`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffallibleinc%2Fpysession","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffallibleinc%2Fpysession","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffallibleinc%2Fpysession/lists"}