Share your nbdev project 📜

Show us what you created using nbdev! :smiley: Please feel free to ask questions about how people customized their packages, dev workflows, docs sites, etc – and share your own customizations too.

For Quarto projects, check out the corresponding Quarto topic.

4 Likes

I’ll start :slight_smile:

Of course, nbdev (docs) itself is written using nbdev – including the fancy landing page! It’s all open source, and we often use cutting edge features from both nbdev and Quarto, so the source is a useful place to learn about both.

I’ve also created a couple small exploratory projects using nbdev. Since its so easy to setup a new project, I use it as a sandbox to test new ideas:

  • fastdaemon (docs): Host a tiny socketserver to speed up repeated runs of the same Python script. This was my attempt at implementing an idea of Jeremy’s. Pretty cool educational project to attempt yourself since it brings together a bunch of useful & interesting software tools and Python standard libraries like: sockets, socketserver, threading, and parallel processing.
  • nbdev-sqlite-utils (docs): Port of some of the docs of Simon Willison’s sqlite-utils package. I noticed that their docs looked a lot like a notebook, so made an attempt to see what it would look like in nbdev. I think it was a positive experiment! There’s also a tiny restructured text to ipynb converter.
  • sketch-tmpdir (docs): Sketch of a tempdir interface better suited to notebook-driven development. The standard library’s context manager approach doesn’t work well since you can’t split it across cells.
7 Likes

Wait for me. Im building it :yum: (chemistry, material science and physics projects)

4 Likes

I created a larger version of the Movie Lense recommender that functions within the blog automatically via gradio created in github pages.
Try it out HERE

3 Likes

I work with geospatial data, so I’ve made this package (name change might come) to put together things I usually have to do, like

  • Mosaicking and demosaicking
  • Converting shapefiles/geojsons/etc to raster data for semantic segmentation
  • Converting shapefiles/geojsons/etc to COCO-format
  • Custom dataloaders/TensorImages for multispectral/hyperspectral images
8 Likes

Nice work Janne!

1 Like

Here is a nbdev documentation only GPT-3 starter example.

Note: It took me a while to realize I had to get rid of all #| export lines I had originally added

3 Likes

Everyone has great projects.

Mine is not impressive at all.
I am still learning Python and software development, so I’m not sure what to create, yet.

But at least this is a starting point.

5 Likes

@galopy your ghost vs. aliens blog post is pretty cool! This is where it starts, keep it up!

5 Likes

Thank you! I will!

3 Likes

I created DS Blocks based on nbdev, please check it here:

The objective of this library is to facilitate writing modular, compact, and decoupled data science pipelines, while getting rid of boiler-plate associated with common operations such as chekpointing, profiling, data conversion, and other functionalities. In particular, it also contains extensions to nbdev that allow to build a test suite to be consumed by pytest, as explained here:

and to freeze and unfreeze code cells to avoid re-running them, while preserving their outputs.

4 Likes

Started a TIL blog, it utilizes Code Notes to privide the explanation more than the text in the notebook so that code can be copied and glanced at quickly :slight_smile:

https://muellerzr.github.io/til

6 Likes

I wrote my first open-source library using nbdev: streamlit-jupyter

It allows for seamless creation of streamlit apps in jupyter notebooks.

A nifty little alternative to voila, one might say.

The way this works is it detects your environment, and if the script is run from a jupyter notebook, then it wraps existing streamlit methods to replace them with ipywidgets alternatives - that way you can code as you would in streamlit, and then displays your page as-you-code.

Then you export your notebook to a .py file, and run it via streamlit as usual (no change in behaviour there)

Install

pip install streamlit_jupyter

How to use it

Take a look at our example notebook

The main idea is for you experiment and develop in your notebook,
visually see all the pieces, and then convert the notebook to .py to
be run by streamlit

start by importing streamlit and patching it with streamlit-jupyter:


import streamlit as st

from streamlit_jupyter import StreamlitPatcher, tqdm

StreamlitPatcher().jupyter()  # register streamlit with jupyter-compatible wrappers

And now develop your notebook as usual, but with the ability to use
Streamlit widgets and components.

See how it works below, and check out the example (it also incudes a nifty alternative to nbconvert that strips out all the magics and other irrelevant stuff)

Demonstration

Jupyter Streamlit
Markdown and headings
Interactive data entry
Pick and choose alt alt
Dataframes, caching and progress bars alt alt
Plots

ps

This is a very early beta and my first try at open source, so please share your thoughts and reach out with any questions/critiques!

7 Likes

I adapted and expanded a pre-existing project creating a Stata jupyter kernel and have really enjoyed using nbdev:

One thing I’ve been stuck on is getting the conda publish to work.

4 Likes

I implemented RLHF using nbdev: GitHub - xrsrke/instructGOOSE: Implementation of Reinforcement Learning from Human Feedback (RLHF)

1 Like

Let me know if you want help with that - it’s something I largely created for myself, so there’s rough edges.

2 Likes

This sounds amazing! How are you finding it to use, in practice?

2 Likes

@ddobrinskiy I wonder if you might be open to writing a blog post about your project? I’d love to help share your project with the world and I think a post describing what you’ve built and why it’s helpful would be great! Especially if it discussed a bit about what Streamlit and nbdev are, and why you like them.

1 Like

This sounds amazing! How are you finding it to use, in practice?

Thank you for the kind words, this means a lot coming from you :slight_smile:

I had an app with multiple notebooks running at work without any trouble.

Combined with nbdev, this is a great experience where iterating on data exploration and sharing the results with stakeholders meld together and save me a lot of time.

So far, the toy example from main codebase runs smoothly at https://ddobrinskiy-jupyter.streamlit.app/

2 Likes

That would be wonderful!

Please find the blog post here: David’s Blog - New library streamlit-jupyter, a new way to develop streamlit apps in jupyter notebooks

Also, my twitter handle is @daviddobrinskiy

2 Likes