Skip to main content
#+TITLE: orgmod

[[https://img.shields.io/pypi/v/ledge.svg?style=flat-square]]

Write literate python modules in org mode and import directly in python.
Inspired by [[https://github.com/miedzinski/import-pypi][import-pypi]]. Relies on org-babel and tangling facility.

As an example, lets make this README an importable module. Lets define a
~hello_world~ function.

#+BEGIN_SRC python :tangle yes
def hello_world():
print("hello world")
#+END_SRC

In the header for the above code snippet, we set ~:tangle yes~ (checkout the raw
version of this file). This creates a module with the name ~README~.

Now to import this module we first import ~orgmod~ and then import ~README~ and then
run the next code right inside this file.

#+BEGIN_SRC python :results output :exports both
# For this code block, tangle is not set
import orgmod
import README

README.hello_world()
#+END_SRC

#+RESULTS:
: hello world

-----

*Things to do*

- Make the loader and finder more robust and inherit from the newer abstract
classes.
- Move next iterations of orgmod itself inside this README. Might need to
bootstrap from the simpler script thats present right now.

Metadata

Release files for orgmod 0.1.1

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

Source distribution (sdist)

Source distribution for orgmod 0.1.1
File Size Uploaded
orgmod-0.1.1.tar.gz 14.8 kB Details

Release files / orgmod-0.1.1.tar.gz

Download URL orgmod-0.1.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d952582de3fa5286681565411cf41a267522bf0d35440a3feab33506b972ba54
BLAKE2b-256 checksum
How to use checksums
608c051e9e5a71a4388d021e0266f3e9485073fb7e47892fc9dc708a1b4cc738
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

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