Skip to content

admidori/cosense-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cosense-cli

CI PyPI version MIT License

The unofficial CLI reader of the Cosense.
This project uses Cosense API.

Installation

pip install cosense

For Windows users

If you install the CLI tool created by Python for the first time, this program may be not operation.
Please execute the below on your PowerShell before execute this program.

$env:PATH += ";" + (Get-Item (python -m site --user-site)).parent.fullname + "\Scripts"

(Reference: https://zenn.dev/kumazo/articles/35215498b86939)

Note

Windows support is not enough. So sometimes layout is broken and occur any problem.
If you are Windows hacker, Please contribute our repository ;)

Basic Use

Commandline

cosense search help-jp

Use Cosense API in Python

import cosense

client = cosense.Client()
project = client.get("/help-jp/")

Advance Use (For private project)

Check the your token

  1. Access your Cosense project page
  2. Check Cookies information (In Chrome, press F12 and show the "Application" tab)
  3. Copy value of connect.sid

Commandline

# Replace the "your token" to "connect.sid"
cosense search "your project name" --auth "your token"

Use Cosense API in Python

import cosense

# Define sid on value of "connect.sid"
sid = "s%3Ag8zuk3JlDhp1t2o45eE5Aj3kK3yHkT_N.ipbmkRVRIP..."
your_project_name = "project"
client = cosense.Client(sid = sid)
project = client.get(f"/{your_project_name}/")

Lisence

This project is published under the MIT lisence.
And this repository is based on kaisugi/scrapbox-python.

About

The unofficial CLI reader of the Cosense

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages