Skip to main content

🐣 piyo

esa API v1 client library, written in Python

Downloads Downloads Downloads

Installation

Install this library using pip from PyPI

pip install piyo

Usage By purpose

Preparation

from piyo import Client

client = Client(access_token='<access_token>', current_team='<team_name>')

Search article

Set search keywords and options.

See official documents for details: https://docs.esa.io/posts/102#%E8%A8%98%E4%BA%8B

keywords = ["diary", "secret"]
search_options = {
    "sort": "created"
}
posts = client.posts(keywords=keywords, search_options=search_options)

Usage

from piyo import Client

client = Client(access_token='<access_token>', current_team='<team_name>')
# Client will look up environment variables "ESA_ACCESS_TOKEN", so you can set access token 
# to ESA_ACCESS_TOKEN instead of pass it to Client.

client.user()
#=> GET /v1/user

client.teams()
#=> GET /v1/teams

client.team()
#=> GET /v1/teams/<team_name>

client.stats()
#=> GET /v1/teams/<team_name>/stats

client.members()
#=> GET /v1/teams/<team_name>/members

client.delete_member()
#=> DELETE /v1/teams/<team_name>/members/1

client.posts(keywords=["diary secret"], search_options={"sort": "created"})
#=> GET /v1/teams/<team_name>/posts

client.post(1)
#=> GET /v1/teams/<team_name>/posts/1

client.create_post({post: {name: "hi!"}})
#=> POST /v1/teams/<team_name>/posts

client.update_post(1, {post: {name: "hi!"}})
#=> PATCH /v1/teams/<team_name>/posts/1

client.delete_post(1)
#=> DELETE /v1/teams/<team_name>/posts/1

client.comments()
#=> GET /v1/teams/<team_name>/comments

client.comments(1)
#=> GET /v1/teams/<team_name>/posts/1/comments

client.create_comment(1, {"comment":{"body_md":"LGTM!"}})
#=> POST /v1/teams/<team_name>/posts/1/comments

client.update_comment(234, {"comment":{"body_md":"LGTM!"}})
#=> PATCH /v1/teams/<team_name>/comments/234

client.delete_comment(234)
#=> DELETE /v1/teams/<team_name>/comments/234

client.comment(234)
#=> GET /v1/teams/<team_name>/comments/234

client.add_post_star(1)
#=> POST /v1/teams/<team_name>/posts/1/star

client.delete_post_star(1)
#=> DELETE /v1/teams/<team_name>/posts/1/star

client.stargazers(1)
#=> GET /v1/teams/<team_name>/posts/1/stargazers

client.add_comment_star(234)
#=> POST /v1/teams/<team_name>/comment/234/star

client.delete_comment_star(234)
#=> DELETE /v1/teams/<team_name>/comment/234/star

client.watchers(1)
#=> POST /v1/teams/<team_name>/posts/1/watchers

client.add_watch(1)
#=> POST /v1/teams/<team_name>/posts/1/watch

client.delete_watch(1)
#=> DELETE /v1/teams/<team_name>/posts/1/watch

client.batch_move({})
#=> POST /v1/teams/<team_name>/posts/1/watch

client.regenerate_invitation()
#=> POST /v1/teams/<team_name>/invitation_regenerator

client.send_invitation({"member": {"emails": ["foo@example.com"]})
#=> POST /v1/teams/<team_name>/invitations

client.delete_invitation("mee93383edf699b525e01842d34078e28")
#=> DELETE /v1/teams/<team_name>/invitations/mee93383edf699b525e01842d34078e28

client.invitations()
#=> GET /v1/teams/<team_name>/invitations

client.emojis()
#=> GET /v1/teams/<team_name>/emojis

client.create_emoji({"emoji": {"code": "funny", "image": base64}})
#=> POST /v1/teams/<team_name>/emojis

client.delete_emoji("test_emoji")
#=> DELETE /v1/teams/<team_name>/emojis/test_emoji

Development

issues and pull requests are always welcome!

run integration test

python3 tests/integration_test.py

run unit test

python3 tests/<test_file>.py -v

Metadata

Release files for piyo 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piyo 1.1.2
File Size Uploaded Provenance Actions
piyo-1.1.2.tar.gz 5.2 kB Without provenance Details for piyo-1.1.2.tar.gz

Release files / piyo-1.1.2.tar.gz

Download URL piyo-1.1.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c8a800662c982b5c21a9af8e5ed8055af930c6fa4e19a6fddb566d39e30c43c5
BLAKE2b-256 checksum
How to use checksums
8a03c6496cf6805a96e6028bd660549a665bc034905d155895cc8fae37f9af1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.18

Security for piyo 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page