Skip to main content

Collect data from org-mode/org-roam pages and do some simple analyzing it.

Project description

OrgAnalyze

Collect data from org-mode/org-roam pages and do some simple analyzing it

Items parsed:

  • Lines starting with "CLOCK:" or "#+CLK:" as OrgClock
  • Headers starting with "*", "**", etc. as OrgHeader
  • Tables starting with "|", as OrgTable

read_org_clocks_2

This function parses all *.org files in a given directory. It extracts all clocking information and associates it with its parent header (Feature) and sub-header (Task).

The function returns a tuple containing a list of column names and a list of rows. This structure is ideal for creating a pandas DataFrame.

Example Usage

Let's say you have an org file tasks.org in a directory called my_orgs with the following content:

* Feature A
** Task 1
CLOCK: [2025-10-25 Sat 10:00]--[2025-10-25 Sat 11:30] =>  1:30
** Task 2
CLOCK: [2025-10-25 Sat 12:00]--[2025-10-25 Sat 13:00] =>  1:00

* Feature B
** Task 3
CLOCK: [2025-10-25 Sat 14:00]--[2025-10-25 Sat 14:30] =>  0:30

You can parse this file and analyze the data with pandas like this:

import pandas as pd
from org_analyze.clocks import read_org_clocks_2

# 1. Parse the org files in the directory
columns, rows = read_org_clocks_2('my_orgs')

# 2. Create a pandas DataFrame
df = pd.DataFrame(rows, columns=columns)

# 3. Analyze the data: Group by feature (head1) and sum the duration
feature_hours = df.groupby('head1')['duration'].sum()

print("Total hours per feature:")
print(feature_hours)

Output:

Total hours per feature:
head1
Feature A    2.5
Feature B    0.5
Name: duration, dtype: float64

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

org_analyze-0.1.5-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file org_analyze-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: org_analyze-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for org_analyze-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bab2d3d001e4f5016339e90fc20aa84da8dcc8f36b6fdfb4cba39e3e33b5ed6e
MD5 477ef3fa22cefd6ba80d023880818793
BLAKE2b-256 c7a1d7857e12a66ed07dab9dcae4961bc63df6a4ccd80ad3344b11d018eb68b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page