Skip to main content

A Python package for managing courses, projects, and directories with Notion integration.

Project description

Incept

Incept is a small CLI for turning course outlines into a structured course payload, inserting that payload into your database (currently Notion), and (optionally) preparing a Jellyfin-friendly video folder hierarchy and downloading lesson videos (Rebelway).

This README is written for the “I’m adding a new course” workflow.


What you’ll run most often

  1. Build the payload JSON from chapters.csv + lessons.csv
  2. Add the course to Notion (optionally create Jellyfin folders + artwork)
  3. Download the videos from Rebelway (from lessons.xlsx)

Install / first-time setup

1) Initialize user config (~/.incept)

incept init

This creates:

  • ~/.incept/.env (copied from env.example if missing)
  • ~/.incept/templates/
  • ~/.incept/payload/
  • ~/.incept/mapping/

2) Configure your .env

Edit:

nano ~/.incept/.env

At minimum you usually want:

  • DATABASE_NAME=notion
  • NOTION_API_KEY=...
  • NOTION_COURSE_DATABASE_ID=...

(Your code will also accept --api-key / --database-id overrides, but most of the time .env is easiest.)


Workflow: add a new course

Step 0: Prepare inputs

You generally need:

  • chapters.csv — course chapter list
  • lessons.csv — lesson list with chapter_index
  • For downloading videos: lessons.xlsx (sheet: lessons) with columns:
    • chapter_index
    • name
    • link

Note: the downloader currently reads Excel, not CSV.


1) Build the payload JSON

Command:

incept build-payload \
  --course-name "Coding Generative AI" \
  --course-desc "..." \
  --intro-link "https://rebelway.academy/lessons/welcome-83/" \
  --chapters ~/.incept/payload/chapters.csv \
  --lessons  ~/.incept/payload/lessons.csv \
  --chapter-name-template "Week {i:02d}" \
  --tool 166a1865-b187-8138-8316-dc8288897458 \
  --tool 149a1865-b187-80f9-b21f-c9c96430bf62 \
  --instructor "Felipe Pesantez" \
  --tags Houdini \
  --tags Python \
  --template default \
  --thumb-base-public-id "thumb/base_image" \
  --out ~/.incept/payload/coding_gen_ai.json

Notes:

  • --tool, --instructor, --tags are repeatable flags.
  • --range 2-4 will build only those chapters (useful for testing).
  • --chapter-name-template "Week {i:02d}" formats the chapter names from chapter index.

2) Add the course (insert into Notion)

2a) Insert course (no Jellyfin folders/artwork)

incept add-course --data-file-path ~/.incept/payload/coding_gen_ai.json

2b) Insert + create Jellyfin video folder hierarchy (+ artwork)

incept add-course --data-file-path ~/.incept/payload/coding_gen_ai.json --include-video

What --include-video does (high level):

  • Creates a Jellyfin-friendly folder structure
  • Generates artwork (poster/thumb/logo/background)
  • Stores the full episode paths in Notion (so Jellyfin + filesystem match)

3) Download all lesson videos (Rebelway)

This is driven by Excel (lessons.xlsx), not your CSV payload.

incept dl-rebelway \
  --excel  ~/.incept/mapping/lessons.xlsx \
  --output ~/Videos/rebelway/coding_gen_ai \
  --chrome-port 9222

Options:

  • Skip initial rows (if your sheet has headers or you want to resume):
incept dl-rebelway --excel ~/.incept/mapping/lessons.xlsx --output ~/Videos/rebelway/coding_gen_ai --skip-first 10
  • Download only one chapter (week):
incept dl-rebelway --excel ~/.incept/mapping/lessons.xlsx --output ~/Videos/rebelway/coding_gen_ai --range 3
  • Download a chapter range:
incept dl-rebelway --excel ~/.incept/mapping/lessons.xlsx --output ~/Videos/rebelway/coding_gen_ai --range 2-4

How the downloader works (important)

  • It launches Chrome with remote debugging (--chrome-port, default 9222)
  • You log in manually, then hit ENTER in the terminal
  • Selenium reads each lesson page and extracts the “SOURCE” MP4 from the download selector
  • A requests session reuses your Chrome cookies and downloads the file

Troubleshooting

Font error when using --include-video

If you see:

OSError: cannot open resource

It means Pillow can’t open one of the font files used for artwork generation.

Your code currently loads fonts from a package-relative path:

<incept package dir>/.config/fonts/coresansc/

Common causes:

  • Fonts folder is missing (not included in install)
  • Filenames don’t match what the code expects:
    • coresansc35.otf
    • coresansc75.otf
    • coresansc25.otf

Quick checks:

python -c "import incept.asset_generator as a; from pathlib import Path; p=Path(a.__file__).parent/'.config/fonts/coresansc'; print('FONT_DIR=', p); print('exists=', p.exists()); print([x.name for x in p.glob('*')])"

Temporary workaround:

  • Run without --include-video to insert the course first:
incept add-course --data-file-path ~/.incept/payload/coding_gen_ai.json

Recommended long-term fix (implementation idea):

  • Move fonts to ~/.incept/fonts/coresansc and load from there, or
  • Package fonts as data files and load via importlib.resources

“Downloader doesn’t find SOURCE”

If you get warnings like “No SOURCE found”, generate a report:

incept report-broken \
  --excel  ~/.incept/mapping/lessons.xlsx \
  --output ~/.incept/mapping/broken_sources.csv \
  --chrome-port 9222

Quick reference (cheat sheet)

Build payload

incept build-payload --course-name "..." --course-desc "..." --intro-link "..." --chapters chapters.csv --lessons lessons.csv --out payload.json

Insert course

incept add-course --data-file-path payload.json

Insert course + Jellyfin folders

incept add-course --data-file-path payload.json --include-video

Download videos (Rebelway)

incept dl-rebelway --excel lessons.xlsx --output /path/to/videos

Repo layout (high level)

src/incept/cli.py             # click CLI entry points
src/incept/payload.py         # payload building (CSV → nested JSON)
src/incept/courses.py         # DB insert logic (courses/chapters/lessons)
src/incept/utils.py           # folder creation + helper utilities
src/incept/asset_generator.py # Jellyfin artwork generation
src/incept/dl_rebelway.py     # Rebelway lesson page parsing + download loop
src/incept/dl_video.py        # Chrome remote debug + cookies + streaming download

Project details


Download files

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

Source Distribution

incept-0.1.116.tar.gz (273.4 kB view details)

Uploaded Source

Built Distribution

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

incept-0.1.116-py3-none-any.whl (211.5 kB view details)

Uploaded Python 3

File details

Details for the file incept-0.1.116.tar.gz.

File metadata

  • Download URL: incept-0.1.116.tar.gz
  • Upload date:
  • Size: 273.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for incept-0.1.116.tar.gz
Algorithm Hash digest
SHA256 a89739635d9065ecc7e9e8d1341d9b734cd95b32da8bf2a81970bb29f7f75625
MD5 750b43d8bbee59e73185d9437d53912b
BLAKE2b-256 e579475fdb49979ea8e80b8c37881c8becc12e3914a67bcecf7b20fff9ac7ced

See more details on using hashes here.

File details

Details for the file incept-0.1.116-py3-none-any.whl.

File metadata

  • Download URL: incept-0.1.116-py3-none-any.whl
  • Upload date:
  • Size: 211.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for incept-0.1.116-py3-none-any.whl
Algorithm Hash digest
SHA256 b0027da4b6afcf9e928b5e0f15cd539d47df44ad52cc46b9747da625b5d3dbc7
MD5 e3ce136b0c1bedd24e8fce00ec77c31f
BLAKE2b-256 41cb186fa2d4ac03b16a3513bfb903a2a1efbd4662351fbac75f964d23235b8a

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