Skip to main content

Modular Notebooks

Imagine an easy way to reuse Python notebooks in the cloud. datamachine is a useful Python package that enables you to import notebooks as modules. With datamachine, you can load notebooks from various sources such as local files, Colab links, and Github links, and then import them with ease. You can also organize notebooks into libraries that use simple codes for easy access to commonly used notebooks.

Features

  • Import notebooks as modules: Importing notebooks as modules is a breeze with datamachine. You can import notebooks from various sources such as local files, Colab links, Github links, and HTTP links.

  • Libraries: datamachine supports user-defined libraries that will make your reusable notebook modules much easier to publish and use by others.

  • Notebook sources: You can currently source public notebooks from GitHub, Colab, and notebooks in your local file system. I plan on adding secure notebook access and extending storage options to S3, Azure, GCP, and other cloud-based systems. Please add an issue to GitHub if you're intersted in support for a particular source.

Installation

To install datamachine, run the following command:

pip install datamachine

Importing datamachine

Once you've installed datamachine, you can import it. The convention is to name the module instance dm.

import datamachine as dm

Notebook Locations

datamachine currrently supports notebook links from Github, Google Colab, local file paths, and public https links with raw content.

Importing a Notebook as a Module

To import a notebook as a module, use the import_notebook function:

nbo = dm.import_notebook(
    "https://colab.research.google.com/drive/1y7x3BDkmaz6k93QjENanKHudLV8xB96Q?usp=sharing",
)

This function imports the notebook located at the specified location and returns a module reference like the native import command. The Colab notebook used above provides sample analytics that can be accessed by using methods in the module. For instance, you could run the following function

nbo.monthly_rulings()

Conclusion

datamachine is a powerful tool for anyone who wants to reuse Python notebooks. With its flexible features and easy-to-use commands, datamachine makes it easy to import notebooks from various sources, store collections of code and their corresponding links in a library, and organize your code with an index. So why wait? Install datamachine today and take your notebook experience to the next level!

Metadata

Release files for datamachine 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datamachine 0.1.6
File Size Uploaded Provenance
datamachine-0.1.6.tar.gz 6.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for datamachine 0.1.6
File Interpreter ABI Platform
datamachine-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / datamachine-0.1.6.tar.gz

Download URL datamachine-0.1.6.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
53acbb877fadb543d316fc1c49ddf15860d629af792ea47b6bf8d0a85c68de8e
BLAKE2b-256 checksum
How to use checksums
2f0f48ea5877e49e191ddd8b8647807975f5d283c20639c1c1591b8690fe566e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / datamachine-0.1.6-py3-none-any.whl

Download URL datamachine-0.1.6-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86ff09e4a4571f922ae9715fe4385c3537754a7dc7cfc334defcc2c1022a9e7a
BLAKE2b-256 checksum
How to use checksums
6887a16aafc4ec74e7abaa422ac3050a6b8ea650842b1200abaf186ac8452849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Security for datamachine 0.1.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page