New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

elvis-repl

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elvis-repl

Elvis has left the building - A REPL template engine that remembers

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

Elvis Has Left the Building

Generate Python code strings to recreate objects with their current state. Perfect for:

  • Saving exact object recreation code
  • Working in terminals where copy-paste is painful
  • Quick templating of repetitive code

Some say it's pointless. Some say it's brilliant. Elvis doesn't care either way - Elvis has already left the building.

Install

pip install elvis-repl

Usage

from elvis_repl import elvis

# Generate object creation code
elvis("df = pd.read_csv(\"{file}\", skiprows={skip})", 
      file="data.csv", skip=2)
# Output: df = pd.read_csv("data.csv", skiprows=2)

# Reuse with changed variables
elvis._vars['skip'] = 3
elvis("df = pd.read_csv(\"{file}\", skiprows={skip})")

# Generate multiple similar objects
for i in range(2):
    elvis("obj_{id} = MyClass(\"{name}\")", id=i, name=f"instance_{i}")

Features

  • Remember variables between templates
  • Preview code before execution with .show()
  • Execute when ready with .run()
  • Works in both Jupyter and CLI

Remember: When your session crashes, Elvis makes sure you know how to rebuild everything exactly as it was.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc