• Stars
    star
    16
  • Rank 1,270,064 (Top 26 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dependency management and optimization in Jupyter Notebooks

jupyter-nbrequirements ย License

Dependabot Status Node CI ย  Release

Dependency management and optimization in Jupyter Notebooks.


About

This extension provides control over the notebook dependencies.

The main goals of the project are the following:

  • manage notebook requirements without leaving the notebook
  • provide a unique and optimized* environment for each notebook

*The requirements are optimized using the Thoth resolution engine


Installation

pip install jupyter-nbrequirements

And enable the required extensions (might not be needed with the latest version, but to be sure..)

jupyter nbextension install --user --py jupyter_nbrequirements

Usage

NBRequirements UI

Since v0.4.0, we've introduced a new UI! Check it out, interact with it and see what it can offer you!

NBRequirements UI

Our development efforts will from now on focus primarily on improving the UI.

The old-school approach

The Jupyter magic is in sync with the UI, so don't worry old schoolers, you can still run the commands manually and the existing notebooks will work!

Create the environment for the notebook to run in

Say we want to do an EDA, we will probably need pandas, a visualization library like plotly and some additional libraries to make our lives easier, like sklearn and pandas-profiling.

In a Jupyter notebook cell:

%dep add pandas --version ">=0.24.0"
%dep add plotly
%dep add sklearn
%dep add pandas-profiling

And perhaps our code would need some refactoring and linter checks later on, so let's add a dev dependency.

%dep add --dev black

You can now check the requirements that your notebook has by issuing %requirements (or %dep, which is just an alias for it) command:

%requirements
[packages]
pandas = ">=0.24.0"
plotly = "*"
sklearn = "*"
pandas-profiling = "*"

[dev-packages]
black = "*"

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[requires]
python_version = "3.6"

Up to this point, we've been working only with the metadata. In order to create the environment and actually install the dependencies, you run the %dep ensure command (insipired by the golang's dep, for those familiar with Golang).

%dep ensure

Since this project is still under development and it uses the Thoth resolution engine to optimize the notebook dependencies (which is also still under development as well), in case something goes wrong, ensure accepts the engine parameter, which can be set to pipenv

%dep ensure --engine pipenv

Check out the examples for more info.


Future plans:

See the Project Board.



Author: Marek Cermak [email protected], @AICoE - Project Thoth

More Repositories

1

micropipenv

A lightweight wrapper for pip to support requirements.txt, Pipenv and Poetry lock files or converting them to pip-tools compatible output. Designed for containerized Python applications but not limited to them.
Python
225
star
2

adviser

The recommendation engine for Python software stacks and Dependency Monkey in project Thoth.
Python
31
star
3

core

Using Artificial Intelligence to analyse and recommend Software Stacks for Artificial Intelligence applications.
Go
28
star
4

kebechet

I'm Kebechet bot, goddess of freshness - I will keep your source code fresh and up-to-date
Python
23
star
5

invectio

Statically analyze sources and extract information about called or exported library functions in Python applications
Python
20
star
6

prescriptions

โš•๏ธ๐Ÿ’Š Prescriptions to heal your applications and application dependencies ๐Ÿ’Šโš•๏ธ
Python
17
star
7

jupyterlab-requirements

JupyterLab Extension for dependency management and optimization
Jupyter Notebook
16
star
8

solver

Dependency solver for the Thoth project
Python
16
star
9

storages

Storage and database adapters for project Thoth
Python
14
star
10

thamos

A CLI tool and library for communicating with Thoth
Python
14
star
11

thoth

Platform for analyzing and recommending Python packages and Python software stacks not only for AI/ML applications
Python
14
star
12

thoth-application

Thoth-Station ArgoCD Applications
Open Policy Agent
13
star
13

glyph

Generate CHANGELOG entries out of commit messages using AI/ML techniques
Python
11
star
14

amun-api

Thoth's execution engine for inspecting quality, performance, and usability of software and software stacks in a cluster.
Dockerfile
8
star
15

user-api

Web Service exposing Thoth functions to the RESTful worlds
Python
8
star
16

s2i-minimal-notebook

A minimal Jupyter Notebook S2I image
Shell
8
star
17

template-project

This is a Template for any Python based project
Python
7
star
18

ansible-role-argo-workflows

Ansible Role - Argo Workflows
7
star
19

search

Visualize Python package metadata and browse advisory results.
TypeScript
6
star
20

mi

an experiment on Source Operation Metrics
Python
6
star
21

s2i-thoth

Thoth's addition to OpenShift's s2i Python builds to benefit from Thoth's recommendations in your application
Dockerfile
6
star
22

talks

Talks, presentations and research papers published about Thoth
5
star
23

datasets

Thoth Datasets to share Thoth heritage and create new ideas...
Jupyter Notebook
5
star
24

python

Library for Python related code
Python
4
star
25

si-bandit

Thoth's Security Indicator using bandit
Python
4
star
26

common

A common library for the Thoth project
Python
4
star
27

integration-tests

Integration tests for the Thoth project to make sure deployment works as expected
Python
4
star
28

si-aggregator

Thoth's Security Indicator Aggregator
Python
4
star
29

notebooks

A set of notebooks to experiment with data in project Thoth
Jupyter Notebook
4
star
30

investigator

Thoth investigator is a Kafka based component that consumes all messages produced by Thoth components.
Python
4
star
31

meteor-operator

Project Meteor Operator for OpenShift
Go
4
star
32

report-processing

Library for processing all outputs/reports produced by Thoth components.
Python
4
star
33

cli-examples

Examples of Thoth's recommendations using Thamos CLI
Python
4
star
34

workflow-helpers

All code required to help workflows (e.g Argo).
Python
3
star
35

management-api

An API service used for administration of deployed Thoth
Python
3
star
36

s2i-example

An example of Thoth's recommendations in OpenShift's s2i builds for a TensorFlow stack
Python
3
star
37

cve-update-job

Update Thoth's database of CVEs
Python
3
star
38

sentry-openshift

Deployment of Sentry onto OpenShift for monitoring your OpenShift application
3
star
39

messaging

This is Thoth messaging, I will send my knowledge to the Universe!
Python
3
star
40

jupyternb-build-pipeline

Openshift-pipelines and tekton based pipeline for packaging jupyternb in to image.
3
star
41

thoth-station.github.io

Project Thoth website
JavaScript
3
star
42

thoth-toolbox

This is a Thoth tool box! A toolbox of Thoth tools...
Dockerfile
3
star
43

license-solver

Detect license information from Python package metadata as provided by thoth-solver
Python
3
star
44

thoth-pre-commit-hook

Thoth adviser pre-commit hooks.
Python
3
star
45

s2i-generic-data-science-notebook

Shell
2
star
46

zuul-config

Python
2
star
47

metrics-exporter

This is a Prometheus exporter for Thoth.
Python
2
star
48

fext

Fast CPython extensions to Python standard library with focus on performance.
C++
2
star
49

dependency-monkey

The "Dependency Monkey" is a service for validating of package dependencies within an application stack.
Python
2
star
50

graph-sync-job

Job for syncing data from object store to a graph database
Python
2
star
51

jupyter-notebook

Jupyter notebook s2i build for project Thoth
Shell
2
star
52

package-update-job

Aggregate updates from Packages hosted in Indices...
Python
2
star
53

jupyter-notebook-s2i

Jupyter notebook S2I builder image.
Shell
2
star
54

goblinoid

Create a graph database schema and indexes from source code automatically
Python
2
star
55

sync-job

A one time job to sync all Thoth data
Python
2
star
56

amun-client

A library for communicating with Amun API
Python
2
star
57

package-releases-job

A job for monitoring new releases on PyPI and creating relevant entries in the graph database
Python
2
star
58

opendatahub-cnbi

A repository for the OpenDataHub CNBi feature.
2
star
59

source-management

Thoth's interaction library for different source management systems
Python
2
star
60

s2i-example-flask

Example of an Python's s2i application consuming Thoth's recommendations
Shell
2
star
61

workflows

Argo workflows used to get certain Thoth jobs done.
Shell
2
star
62

buildlog-parser

Parse OpenShift's s2i build log into its structured representation with all the metadata available
Python
2
star
63

slo-reporter

Provide report on Thoth Service Level Objectives (SLO) to stakeholders.
Python
2
star
64

stub-api

This is a project demonstrating the basic structure of a API Service as used by the Thoth-Station.
Python
2
star
65

si-cloc

Thoth's Security Indicator using cloc
Python
2
star
66

qeb-hwt

I'm Kebechet bot, goddess of freshness - I will keep your dependencies fresh and up-to-date
Python
2
star
67

revsolver

A reverse solver implementation
Python
1
star
68

socrates

Experimental project on reviewer recommendation based on source code and srcops analysis.
Python
1
star
69

solver-errors-reporter

Cluster solver errors collected by Thoth Dependency Solver and report back to take actions.
Jupyter Notebook
1
star
70

ansible-role-core-templates

This Ansible role will create an OpenShift Templates required to deploy Thoth.
1
star
71

init-job

Thoth's initialization job that automatically initializes a fresh deployment
Python
1
star
72

prescriptions-refresh-job

A periodic job to refresh Thoth's prescriptions
Python
1
star
73

reporter

Thoth Reporter to provide information on status of thoth services from analysis of documents stored on Ceph.
Python
1
star
74

pulp-metrics-exporter

Metrics exporter exporting information about Pulp
Python
1
star
75

tensorflow-serving-build

Tensorflow serving binary build
Shell
1
star
76

ansible-role-core-imagestreams

A set of Ansible Roles used by Thoth
Shell
1
star
77

external-janusgraph-service

This Ansible role will create an OpenShift Service object to integrate an external JanusGraph Server.
1
star
78

nepthys

Bringing your code back to live as an interactive documentation automatically
Shell
1
star
79

aicoe-ci-pulp-upload-example

A small example demonstrating Python package releases uploaded using AICoE-CI to Operate First Pulp instance.
Python
1
star
80

cleanup-job

A job for cleaning up old OpenShift objects created by one-time analyses
Python
1
star
81

ansible-role-postgresql

Ansible role to provision PostgreSQL into Thoth
1
star
82

srcops-testing

This is a SrcOps test repository
Python
1
star
83

isis-api

API exposing algorithms on top of project2vec
Python
1
star
84

ps-nlp

This is a repository for a Predictive Stack for Natural Language Processing (NLP)
Shell
1
star
85

s2i-example-migration

An example repository for a project to be migrated to use Thoth (demo)
Python
1
star
86

image-pusher

Push images to an external registry from internal OpenShift registry
Python
1
star
87

selinon-worker

Selinon worker used for data gathering, data cleansing and experiments in project Thoth
Python
1
star
88

s2i

Tooling and a library for Thoth's Python Source-To-Image (s2i) applications
Python
1
star
89

performance

Scripts to benchmark libraries used by Amun
Python
1
star
90

osiris

Build log aggregation service which integrates with OpenShift and Ceph storage.
Python
1
star
91

ansible-role-cronjob

Create a Thoth CronJob in an OpenShift Project/namespace.
1
star
92

build-watcher

Watch for builds done in OpenShift and automatically submit new images to Thoth's image analysis
Python
1
star
93

graph-refresh-job

A job for scheduling solver to resolve dependency graphs of new packages
Python
1
star
94

package-extract

Manipulation with package dependencies in containers and install logs
Python
1
star