Skip to main content

Export Bear blog CSV data to organized markdown files

Project description

Bear Export CLI Tool

A command-line tool to export Bear blog CSV data to organized markdown files.

Installation

Install with uvx (recommended)

uvx bear-export

Usage

Using uvx (recommended)

uvx bear-export [OPTIONS]

Options

  • -c, --csv-file TEXT: Path to Bear blog CSV export file (default: post_export.csv)
  • -o, --output-dir TEXT: Output directory name (default: Blog)
  • --include-drafts: Include unpublished draft posts
  • --organize-by [date|tags|none]: Organize files by date, tags, or no organization (default: none)
  • --front-matter [yaml|toml|none]: Front matter format for static site generators (default: yaml)

Examples

Basic export (published posts only, flat structure):

python main.py

Include drafts and organize by date:

python main.py --include-drafts --organize-by date

Organize by tags with TOML front matter:

python main.py --organize-by tags --front-matter toml

Custom CSV file and output directory:

python main.py --csv-file my_export.csv --output-dir MyBlog

Output Structure

Flat Organization (default)

Blog/
├── post1.md
├── post2.md
├── post3.md
└── README.md

Date Organization

Blog/
├── 2023/
│   ├── 01/
│   │   ├── january-post.md
│   │   └── another-january-post.md
│   └── 12/
│       └── december-post.md
├── 2024/
│   └── 03/
│       └── march-post.md
└── README.md

Tags Organization

Blog/
├── personal/
│   ├── my-life.md
│   └── thoughts.md
├── coding/
│   ├── python-tips.md
│   └── vim-guide.md
├── uncategorized-post.md
└── README.md

Front Matter

The tool generates front matter compatible with static site generators like Hugo, Jekyll, and others.

YAML Front Matter (default)

---
title: My Blog Post
slug: my-blog-post
date: 2024-03-15T10:30:00
tags:
  - personal
  - coding
lang: en
published: true
type: post
uid: abc123
---

TOML Front Matter

+++
title = 'My Blog Post'
slug = 'my-blog-post'
date = '2024-03-15T10:30:00'
tags = ['personal', 'coding']
lang = 'en'
published = true
type = 'post'
uid = 'abc123'
+++

Features

  • Parse Bear blog CSV exports with proper encoding
  • Generate clean markdown files with front matter
  • Support for YAML and TOML front matter formats
  • Multiple organization strategies (flat, by date, by tags)
  • Filter published/draft posts
  • Generate index/README file with post listings
  • Handle special characters and filenames safely
  • Preserve post metadata (tags, dates, language, etc.)

Requirements

  • Python 3.7+
  • pandas
  • click
  • pyyaml
  • python-dateutil

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

bear_export-0.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

bear_export-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file bear_export-0.1.1.tar.gz.

File metadata

  • Download URL: bear_export-0.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bear_export-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e54f3704566ae7261ea0c03bb956492e07de220ed9e20bf3c2b9a5bdad4e7b5c
MD5 cf2dc8fe0299670e3d63af0fa194a330
BLAKE2b-256 f033857e736c21d61fcae2304b88ace4420c43a72a22af903eca9801b28b3325

See more details on using hashes here.

File details

Details for the file bear_export-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bear_export-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bear_export-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30484ca1337207091e4dc01c2c673e45857fd8300d28d8ec80a104b59307d3d8
MD5 094e2d3211bed79c52e8d7f4882ef89f
BLAKE2b-256 12768af55f2ff5efce7d137d97ce231f6c7e4e2d1bb22cc2d5713aeadc9821e8

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