Snarky
Snarky is a useless Python package that makes it easy to add a jk (just kidding!) keyword argument to any function. Moreover, snarky defines several default behaviors for reacting whenever jk==True.
Quick examples
Using snarky is really easy. Suppose we have a function:
def my_fun(a, b):
"""Sample function with arguments."""
return a*b
Then calling our function might look like this:
>>> my_func(4, 5)
20
>>> my_func(a=3, b=7)
21
>>> my_func(a=3, b=7, jk=True)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-143-231ea24720af> in <module>()
----> 1 my_func(a=3, b=7, jk=True)
TypeError: my_func() got an unexpected keyword argument 'jk'
But that’s lame! What function doesn’t give you the option to say ‘just kidding!’, right?
That’s where snarky shines!
Simply add one of several default behaviors, or even define your own! Here, we will apply the default snarky behavior to our function:
from snarky import *
@snarky
def my_fun(a, b):
"""Sample function with arguments."""
return a*b
Now calling our function might look like this:
>>> my_func(4, 5)
20
>>> my_func(a=3, b=7)
21
>>> my_func(a=3, b=7, jk=True)
LOL! Then why are you asking me to run 'my_func'? Unbelievable!
21
And the day is saved.
Installation
The easiest way to install snarky is to use pip. From the terminal, run:
$ pip install snarky
Alternatively, you can install the latest version of snarky by running the following commands:
$ git clone https://github.com/eackermann/snarky.git
$ cd snarky
$ python setup.py install
License
Snarky is distributed under the MIT license. See the LICENSE file for details.
Metadata
Release files for snarky 0.0.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 | |
|---|---|---|---|---|
| snarky-0.0.1.tar.gz | 3.2 kB | Without provenance | Details |
Release files / snarky-0.0.1.tar.gz
| Download URL | snarky-0.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30540663941b845d5cbd5dd3afc156ecd10fb5dc7b276694d98f2e7dbda1fb83
|
|
BLAKE2b-256 checksum How to use checksums |
071da3b11a1e7e9d70faeb9ec44369cb1fd8ec613da66a02345eb8666f471452
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for snarky 0.0.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.