Skip to main content

WordPress APIを活用して記事を投稿・管理するCLIツール

Project description

wpctl

WordPress APIを活用して、記事を投稿・管理するCLIツール。

概要

MarkDown / テキスト / HTMLファイルを読み込み、WordPress REST APIを通じて記事の投稿・更新を行います。

機能

機能 コマンド 説明
記事投稿 wpctl post create Markdownなどのファイルを記事として投稿する
記事更新 wpctl post update 既存の記事をファイルの内容で更新する

インストール

pip install .

使い方

記事を投稿する

wpctl post create [-t "記事のタイトル"] <FilePath>
引数 オプション 必須 説明
FilePath true 投稿するファイルのパス
title --title, -t 記事タイトル(デフォルト: タイトル未設定

記事を更新する

wpctl post update --id <ID> [-t "記事のタイトル"] <FilePath>
引数 オプション 必須 説明
FilePath true 投稿するファイルのパス
id --id true 更新対象の記事ID
title --title, -t 記事タイトル(デフォルト: タイトル未設定

環境変数

環境変数 必須 説明
WP_USER true WordPressのユーザー名
WP_APP_PASSWORD true WordPressのアプリパスワード

.env ファイルは非対応です。あらかじめシェルの環境変数に設定してください。

対応ファイル形式

  • .txt
  • .md
  • .html

Tool

Test

pip install -r requirements-dev.txt
pytest tests/
# ログを出力する場合
# pytest -s tests/

Lint

pip install -r requirements-dev.txt
ruff check .
# 自動修正する場合
ruff check . --fix

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

wpctl-1.0.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

wpctl-1.0.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file wpctl-1.0.0.tar.gz.

File metadata

  • Download URL: wpctl-1.0.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for wpctl-1.0.0.tar.gz
Algorithm Hash digest
SHA256 de0cbdfddf7bb344e640bb0898e0dfe5d05bb58f30a786381c214214a0e1aa25
MD5 057666adac84ee9c6259393bbf5ece3f
BLAKE2b-256 2cdbe23c2898353d26167c1c6e7f57c3f35fe9adcf80940161e9b2e4871f7bc9

See more details on using hashes here.

File details

Details for the file wpctl-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wpctl-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for wpctl-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 634f4d86e937c2226c293bc2358fa347250083a9599e69896caf2bcec86a105b
MD5 0fc9785d98973ef644beb26baf95a9fd
BLAKE2b-256 d546674c9a6b34f41beabf9948f48be1b8d49f0646f9a3c88040a9fba18da7dc

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