r/Python • • Apr 21 '24

Showcase Alternative data managment tool to replace the need to use Jupyter Notebook for Python

What My Project Does:

For everyone who says they use jupyter Notebook for Python to do chunks of code work… I developed my own data management system for that kind of stuff that provides a wrapper over serialization that essentially creates pythonic pointers to data on any network drive. I just grab my data that I want to grab. Provides autocomplete and C# like attributes. I can dynamically build any data storage class using UML formatted infrastructure-as-code to build the front end. The back end is completely dynamic. Here is the pypi link. Note that I developed this to handle genomic data that was generated over the course of a week of 24/7 computation, that I break into multiple logical chunks. You dont need to rely on Jupyter to hold your data and you can retrieve it months after generating it.

This software routes the data to whatever means you use. It works with databases, pickles, yaml. You just have to add your interface in the data routing class. I just did yaml to start. This is just a wrapper around everything so you can declare your class like normal and at variable declaration you have data permanence instantly with no user interaction.

If you pass Y=1 and power off your computer and turn it back on again Y still equals 1 when you call that variable instantly

Target Audience (e.g., Is it meant for production, just a toy project, etc.)

production as I use it for my genomic research on my project with Stanford

Comparison (A brief comparison explaining how it differs from existing alternatives.):

There is no alternatve to this project as far as i know. It replaces the need for Jupyter Notebook to hold your data as you can retrieve it months after generating it.

PyPi:

https://pypi.org/project/data-nut-squirrel/

Source Code:

https://github.com/LunarFawn/rna_squirrel

Edit: Here is an example of implementation where I actually gave a shit about documentation.

https://pypi.org/project/serena-rna-tool/

0 Upvotes

25 comments sorted by

View all comments

2

u/arden13 Apr 21 '24

I don't understand how this improves upon standard ETL practices. If your pipeline goes down just re-execute? If having variables pre-loaded is helpful for your work just save *.joblib files.

Otherwise it seems like this is not very different from redis in concept (or at least what I understood from the docs).

2

u/IllogicalLunarBear Apr 21 '24 edited Apr 21 '24

It takes a week to pre-load those variables for my use-case due to the massive amounts of computation that must be done beforehand running 24/7 on a i9. This data cannot be stored in memory and must be stored in a disk for data permanence

Edit: in case it’s not clear I am processing thousands of RNA sequences and holding onto all the genomic data generated by academic RNA folding models and then I perform novel computation of the data to generate novel metrics to explain the behavior of the RNA. It a lot of data that you do not want on volatile memory

2

u/onyxleopard Apr 21 '24

You can persist arbitrary Python objects to disk with joblib: joblib.dump('filename.bz2', obj) and then reload in any session/interpreter with obj = joblib.load('filename.bz2').

1

u/IllogicalLunarBear Apr 21 '24 edited Apr 21 '24

My code removes that extra step. At variable creation it does that all the dumping the background. Then when you call the data it loads everything. This is a wrapper around that all that to allow for addressing, data validation, data manipulation and whatnot in the background so you just use Python like normal sauce but your variables are not in memory, they are on a disk somewhere. Multiple people on different sides of the world can run their Python code using the exact same data variables and classes as everyone is pulling from the same data set. You can stop what you are doing and have someone else on the other side of the world pick up where you left off immediately with no need to communicate about any changes

2

u/onyxleopard Apr 21 '24

You don’t necessarily want to persist every object in memory to disk.  Anyway, if it works for you that’s great.  I’m just pointing out (as others have) that the standard ways to handle serializing data that is the result of expensive computation already exist and are just a couple function calls.  If you really feel like calling dump/load functions is too burdensome, you do you.

1

u/IllogicalLunarBear Apr 21 '24 edited Apr 21 '24

There is a lot more to it than dump and load… this handles the addressing of your data if you are messing around with thousands of instances of the same classes. Like I said it’s a wrapper and yes I do want all of my variables to be on disk and not on memory as if it’s on memory and the script crashes for some reason I will be forced to restart a days worth of work.

The best I can explain it as is the package makes pointers to your data that is on disk in the same way you use pointers in C to address variables in memory