bpmagic is a library to save and load boilerplate code. With a few simple commands, you can save and load bits of frequently used code to speed up programming in iPython and Jupyter.
## Install
bpmagic is up on pip, so you can simply call:
`pip install bpmagic`
## Loading bpmagic
To load the bpmagic namespaces, you can use the load_ext magic function:
`%load_ext bpmagic`
To prevent typing this everytime, you can add this to your ipython profile startup (mine is in `/.ipython/profile_default/startup/`) and place the above command into a `*.ipy` file (you can name it whatever you want, I used `bpmagic.ipy`)
## Save
Using the `%%isave` magic function, you can write and save a chunk of code into a new bpmagic namespace. For example:
```
%%isave data
import pandas as pd
import numpy as np
import scipy as sp
```
This will save your current cell of code into the namespace `data`. If the namespace is already defined, you can overwrite using the -o flag:
```
%%isave plot -o
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
```
## Load
Using the `%iload` function, you can load up 1 or more profiles at once. For example:
`%iload data plot`
This will load the boiler plate code for `data` and `plot` and replace the cell that contained `%iload` with:
```
# data
import pandas as pd
import numpy as np
import scipy as sp
# plot
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
```
## Delete
If you pass a profile name after `%idelete`, you will remove that profile name. Example:
`%idelete data`
## Rename
Passing in the old name followed by the new profile name will change the name of a profile:
`%irename plot plotting`
## List
To get a list of current profiles, simply call `%ilist` in ipython, and it will return a list of all of your current profiles.
Metadata
Release files for bpmagic 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bpmagic-0.13.1.tar.gz | 3.7 kB | Without provenance | Details for bpmagic-0.13.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bpmagic-0.13.1-py3-none-any.whl | Python 3 | none | any | Details for bpmagic-0.13.1-py3-none-any.whl |
Total release size: 8.9 kB
Release files / bpmagic-0.13.1.tar.gz
| Download URL | bpmagic-0.13.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7924c0266d883b6e328afadf20e5a8d5036b8c4c9a5b453a4a6b47643a2b3e5c
|
|
BLAKE2b-256 checksum How to use checksums |
4bb79b00262388eb7b6b436d8dedf6a2567337346b2500425b86c6b191fb5067
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / bpmagic-0.13.1-py3-none-any.whl
| Download URL | bpmagic-0.13.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92a5553c2f54c1cc518c99cd32eaf6817bf4d0e2b7e68cdec42a06d5fcf10079
|
|
BLAKE2b-256 checksum How to use checksums |
f494333689eaf0fc400cb19580ca1ecc752059a446acc7661b2eba105c69cf43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for bpmagic 0.13.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.