Asekuro
A commandline util for jupyter notebooks, possibly to be used in trainings and/or githooks.
Asekuro means insurance in esperanto.
The main goal is to have a commandline app that can be used in githooks. The main features we wanted in this app is that we had a nice way to:
- Clear notebook cells
- Be able to confirm that the notebook can run without errors.
- Be able to deal with solutions via
%loadmagic.
Quick-Start
Installation can be done via pip.
> pip install asekuro
Note that we only support python>=3.6.
Usage
Once installed, the commandline app can be used.
> asekuro
Usage: asekuro [OPTIONS] COMMAND [ARGS]...
Asekuro - it means insurance in esperanto.
This command line app allows you to check for errors in jupyter notebooks
and it also allows you to supply a python file with assert statements.
Options:
--help Show this message and exit.
Commands:
check Check (notebook) files in sequention for errors.
clean Clean notebook files.
test Check notebook files independantly.
version Echo the version of asekuro.
Testing a Notebook
We merely test if the notebook can be run from top to bottom without any errors. This may be dependant on the virtualenv that you're currently running.
> asekuro test tests/testnb.ipynb
2018-07-30 15:40:04,060 [commandline.py:test_notebook:113] DEBUG - about to test tests/testnb.ipynb
...
2018-07-30 15:40:04,074 [commandline.py:clean_notebook:82] DEBUG - /tmp/testnb-test.ipynb is now stripped
============== test session starts =======================================================================
platform darwin -- Python 3.6.5, pytest-3.6.4, py-1.5.4, pluggy-0.7.1 --
/Users/coder/path/asekuro/venv/bin/python
cachedir: ../../../../../tmp/.pytest_cache
rootdir: /tmp, inifile:
plugins: nbval-0.9.1
collected 6 items
tmp/testnb-test::ipynb::Cell 0 PASSED [ 16%]
tmp/testnb-test::ipynb::Cell 1 PASSED [ 33%]
tmp/testnb-test::ipynb::Cell 2 PASSED [ 50%]
tmp/testnb-test::ipynb::Cell 3 PASSED [ 66%]
tmp/testnb-test::ipynb::Cell 4 PASSED [ 83%]
tmp/testnb-test::ipynb::Cell 5 PASSED [100%]
============== 6 passed in 1.11 seconds ==================================================================
2018-07-30 15:40:05,983 [commandline.py:test_notebook:118] DEBUG - removing temporary testing notebook /tmp/testnb-test.ipynb
2018-07-30 15:40:05,984 [commandline.py:test_notebook:120] DEBUG - testing done for tests/testnb.ipynb
Clean Notebook
Sometimes you may want to remove the output of the cells. This can be done automatically now too.
> asekuro clean tests/testnb.ipynb
2018-07-30 15:44:23,508 [commandline.py:clean_notebook:76] DEBUG - about to strip tests/testnb.ipynb of output
2018-07-30 15:44:23,516 [commandline.py:clean_notebook:82] DEBUG - tests/testnb.ipynb is now stripped
Testing
You can run some unit tests via pytest. Note that we test using local notebooks
as well as a docker container. We want the container that is there to break the build.
Metadata
Release files for asekuro 0.1.2
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 |
|---|---|---|---|---|
| asekuro-0.1.2.tar.gz | 5.9 kB | Without provenance | Details for asekuro-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asekuro-0.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for asekuro-0.1.2-py2.py3-none-any.whl |
Total release size: 13.2 kB
Release files / asekuro-0.1.2.tar.gz
| Download URL | asekuro-0.1.2.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66f4cfdaa5004886679c8c4cffc45eefb5be8d255ece5c975386c3ea814271c4
|
|
BLAKE2b-256 checksum How to use checksums |
c3ecf38ee0077bd4cc0a2c0bacfea423ca0072d6d3ec341e2d1add9df12c28e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
|
Release files / asekuro-0.1.2-py2.py3-none-any.whl
| Download URL | asekuro-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
664b86646bca429cff47e02f7d2f069bb41c7beabd3b0d37cd1873c1d8238e21
|
|
BLAKE2b-256 checksum How to use checksums |
bbed8dfc3d2fb11f83b289cf08df817dbfd6dd1deeb8bb34e4b8311908a8cbfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
|
Security for asekuro 0.1.2
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.