Skip to main content

spellbook

store and search command lines

problem

http://imgs.xkcd.com/comics/tar.png

The inspiration is user experience in opennssl command line tool. In one of my previous project I was working with openssl command line tool. In the examples below I will use openssl to show you how to use spellbook.

the quickest start

install spellbook:

$ pip install spellbook

create first spellbook, called aux:

$ spellbook aux create

add spell to your spellbook:

$ spellbook aux add "tar -xvzf file.tar.gz" "extract tar.gz archive"

search for it:

$ spellbook aux search tar
tar -xvzf file.tar.gz

documentation

The idea is to create ‘book’ for openssl.

create your first spellbook, called openssl:

$ spellbook openssl create

then create spellbook for linux:

$ spellbook linux create

add

add some data to it, three ways are possible:

format:

$ spellbook <book_name> add [command [description]]

add with command and description:

$ spellbook openssl add "openssl rand 16 -hex" "generate random 16 bytes and encode as hex"
openssl rand 16 -hex::generate random 16 bytes and encode as hex

add with only command:

$ spellbook openssl add "openssl asn1parse -in 3msg.enc.der -inform der"
provide description>> show asn1 encoded file
openssl asn1parse -in 3msg.enc.der -inform der::show asn1 encoded file

add without command:

$ spellbook openssl add
provide command>> openssl des3 -d -in 3msg.enc.msg -K `xxd -p 3msg.dec.key` -iv `xxd -p 3msg.iv`
provide description>> decode file using des3 with key and iv
openssl des3 -d -in 3msg.enc.msg -K `xxd -p 3msg.dec.key` -iv `xxd -p 3msg.iv`::decode file using des3 with key and iv

add something to linux book:

$ spellbook linux add "tar -xvzf file.tar.gz" "extract tar.gz archive"
tar -xvzf file.tar.gz::extract tar.gz archive

list

list all spells:

$ spellbook openssl list
openssl rand 16 -hex    ::>>    generate random 16 bytes and encode as hex
openssl asn1parse -in 3msg.enc.der -inform der  ::>>    show asn1 encoded file
openssl des3 -d -in 3msg.enc.msg -K `xxd -p 3msg.dec.key` -iv `xxd -p 3msg.iv`  ::>>    decode file using des3 with key and iv

dropbox support

just install dropbox or install spellbook with dropbox

$ pip install spellbook[with_dropbox]
or
$ pip install spellbook dropbox

connect to dropbox

$ spellbook - connectdb
1. Go to: https://www.dropbox.com/1/oauth2/authorize?response_type=code&client_id=ow3gosk8pb9bhkr
2. Click "Allow" (you might have to log in first)
3. Copy the authorization code.
provide the authorization code here>> oh4dTc9F_fgAAAAAAAAC3fovgKZ7cPL65mS5Ajxevug
successfully linked account:  DonPiekarz

sync spellbooks with dropbox

all spellbooks will be synchronized with yours dropbox account

$ spellbook - sync

future work

  • some hack to end parse arguments

  • refactoring

Metadata

Release files for spellbook 1.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spellbook 1.1.5
File Size Uploaded Provenance Actions
spellbook-1.1.5.tar.gz 5.7 kB Without provenance Details for spellbook-1.1.5.tar.gz

Release files / spellbook-1.1.5.tar.gz

Download URL spellbook-1.1.5.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d0a0f75868f47f04976a00c447f871d419cb04dc69c31c88c41bec77e99a6214
BLAKE2b-256 checksum
How to use checksums
d6ab36b37ab0e9bb4952b7c206e542181483626fcdd236ffd6c744e249c6bba6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for spellbook 1.1.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page