Giter Site home page Giter Site logo

yanico's Introduction

yanico

Yet Another Niconico-douga Command-line Interface

Description

yanicoApache 2.0 ライセンスで公開されている ニコニコ動画 にアクセスするためのCUIコマンドです。 メインコマンド yan (yanico の先頭3文字)に続けて サブコマンドを指定することで機能を実行します。 機能を集めることができる CUIコマンドを目標にゆっくり開発していきます。 パッケージに含むREADME等のドキュメントは日本語で先に書いていきます。

Feature

  • yan コマンドの体系は git や mercurial のようなサブコマンドの集合です。
  • ログインのセッション情報などはブラウザから取得します。
    • Firefoxのセッション情報を取得します。
    • 他のブラウザへの対応は未定です。
    • コマンドからログインする機能は今のところ未定です。
  • Python と setuptools の知識が必要ですが、 ユーザーが 独自にコマンドを追加 することができます。

Requirement

  • Python (バージョン3.8以降)
  • pip (バージョン10以降)
  • setuptools (バージョン 61.0.0 以降)
  • setuptools_scm
  • サードパーティ製のHTTPライブラリ(予定)

Install

PYPI のリリース版をインストールする:

$ pip install yanico

リポジトリ の最新版をインストールする:

$ pip install git+https://github.com/ma8ma/yanico

Usage

  • ホームディレクトリに設定ファイル .yanico.conf を置きます。 [session] セクションに実行時に使用するセッション情報を読み込む ブラウザのタイプ typeプロファイルのパス profile を設定してください。

設定例:

$ cat <<EOF >~/.yanico.conf
[session]
type = firefox
profile = /home/user/path/to/firefox/profile
EOF

コマンド例:

$ yan subcommand arg1 arg2

Development

開発に使う追加のツールをインストールする:

$ pip install yanico[dev]

Testing

テストを行うには pytest を実行する:

$ pytest

コードカバレッジ( coverage )を計測して結果を表示する:

$ coverage run -m pytest
$ coverage report

Code check

コードをチェックするには pylint を実行する:

$ pylint setup.py tests/ yanico/

Type check

型をチェックするには mypy を実行する:

$ mypy yanico/

Code formatting

ソースコードを整形するには black を実行する:

$ black .

What's New

v0.1.0 (2024-08-06)

  • README.rst に開発ツールのインストールと使い方の説明を追加しました。
  • 廃止予定の pkg_resources のかわりに importlib.metadata を使うように修正しました。
  • The Uncompromising Code Formatter black を使ってソースコードを整形しました。

v0.1.0a4 (2023-09-20)

  • パッケージのビルドに必要なデータは pyproject.toml で定義するように変更しました。(PEP 518)

以前のバージョンでの変更は CHANGES.ja.md を見てください。

TODO

  • コマンドを追加する方法のドキュメントを書く (v1.0.0までには書く)

Copyright 2015-2023 Masayuki Yamamoto

yanico's People

Contributors

ma8ma avatar

Stargazers

 avatar

Watchers

 avatar  avatar

yanico's Issues

Release v0.1.0a1

Enable to download packages from PYPI.

  • Build package files
    • .tar.gz
    • .whl
  • Update CHANGES.ja.md
  • Update README.rst
  • Update setup.py
  • Upload files
  • Update PYPI page

Add attach command

Goal

Make configure file for brower and profile at current directory.

$ yan attach browser-name /path/to/browser/profile
$ ls -A
.yanico-session-conf.json

No include documents in package

v0.1.0a1 distribution package that was uploaded on PYPI, doesn't include documents (e.g. LICENSE).
There is need to write MANIFEST.in for including documents.
Add package_data into setup function.

Update setup script

Tweak the project to be new release (v0.1.0).

  • update development tools
  • provide Makefile to make shortcuts for building and testing
  • move metadata into setup.cfg (require setuptools >= 30.3.0)
  • manage package version by setuptools_scm
  • drop support for 3.3
  • rewrite README and CHANGELOG.

Prepare project

Before starting coding, We need some documents.

  • Add ignore pattern direnv
  • Write README.md in Japanese
    • Description
    • Requirement
    • Installation
    • Usage
    • TODO
    • License
  • Edit LICENSE
  • Create package top module yanico
  • Create test module tests
  • Write package meta data to setup.py

Add main command

Goal

Implement to enable installation of the yan command using pip.

Command features

--help is default runs without command-line arguments.

  • --help option (and alias -h) -- show usage.
  • --version option -- show the program name and version number.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.