Skip to main content

Utilities for Python REPL startup scripts

Project description

pythonrc-manager (wip)

[!warning] Don't use this yet, I'm getting the alpha version ready

Python REPL RC manager that records reloadable imports

Features

  • patch sys.displayhook to pprint (wrapped to preserve other display hook functionality)
  • project-scoped RC scripts (write a custom Python RC file per project) detected with git
  • RCE guards (initially based on git check-ignore, which is an imperfect heuristic for many reasons)
  • allow_reload() a context manager and a context decorator that records module names that can be reloaded in the REPL
  • reload() takes module names recorded in allow_reload sections, pops them from sys.modules and reexecutes your RC file

Maybe also worth adding

  • backported new REPL idioms (clear, exit) for tail-developed projects
  • autoreloading based on a stat watcher in the background thread?

Authors

MIT License
(C) Bartosz Sławecki 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythonrc_manager-0.1.6.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythonrc_manager-0.1.6-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pythonrc_manager-0.1.6.tar.gz.

File metadata

  • Download URL: pythonrc_manager-0.1.6.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pythonrc_manager-0.1.6.tar.gz
Algorithm Hash digest
SHA256 2fb13693a4e75aed0c1b2dbca1c1234bd21b5f826c02965672ff586862cebe67
MD5 64b270b7cd22a63beb17d62253cf7f99
BLAKE2b-256 ef5c049f1ad862341748b36a1a6c7ea666ff4809480b9b2ca1801ecf7b13b4c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonrc_manager-0.1.6.tar.gz:

Publisher: release.yml on bswck/pythonrc-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pythonrc_manager-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pythonrc_manager-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 68954f1699ed8ae1c0f9adb4f8287b66aa6d0a484ce46a8d43a8cfe096c0d625
MD5 2ff41023928de1f7e12b7b67caa5d0c6
BLAKE2b-256 994dabc0f583995e7a30f0867327fd1a58a67b8c6da0164e367f17ce23118edb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonrc_manager-0.1.6-py3-none-any.whl:

Publisher: release.yml on bswck/pythonrc-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page