Type-safe python SDK for HackMD developer
Project description
HackMD Python SDK
It is a Type-safe Python SDK that can let your HackMD development fastly.
Usage
pip install hackmd-sdk-python
# or
python setup.py install
Get Me example
from hackmd.client import Hackmd
hack = Hackmd(token="YOUR_TOKEN")
me = hack.get_me()
print(me.teams[0].name) # Your team name
print(me.name) # Your HackMD name
Create Note example
from hackmd.client import Hackmd
from hackmd.typing.notes import NoteCreate
hack = Hackmd(token="YOUR_TOKEN")
note = NoteCreate(**{
'title': 'New Post',
'content': 'I am Content',
'read_permission': 'owner',
'write_permission': 'owner',
'comment_permission': 'everyone',
})
result = hack.create_note(body=note)
print(result)
Methods
Authentication: X-HackMD-API-Version: 1.0.0
User
- get_me()
- return: Me()
User Note
- get_notes()
- return: List[Notes]
- get_note(note_id=note_id)
- return: Note()
- create_note(body=NoteCreate())
- return: Note()
- update_note(note_id=note_id, body=NoteUpdate())
- return: Note()
- delete_note(note_id=note_id)
- return: ''
- get_read_notes_history()
- return: List[Notes]
Development
git clone
cd hackmd-sdk-python/
pythom -m pytest tests/
License
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
Built Distribution
File details
Details for the file hackmd-sdk-python-0.2.1.tar.gz
.
File metadata
- Download URL: hackmd-sdk-python-0.2.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc529b35f71f5b62e19ce63298b6c57ed8a03f5e13884f35f33c3508fe939c01 |
|
MD5 | dbb688d80a67f1d121d888ab24c5f7e9 |
|
BLAKE2b-256 | 264163df98e337df55657be7cc9ded243ebf74e82e38e1ab6d6b35b3c1a7b6b8 |
Provenance
File details
Details for the file hackmd_sdk_python-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: hackmd_sdk_python-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9502be19b8104ca0e9081796ab07a0401cb5c87de9fd4561987ae39b4bbbe67b |
|
MD5 | d17b2fd0a1da1d7919a4ee0b5c271c8f |
|
BLAKE2b-256 | bffb5edf3ae62993f83578930c05a6c4a5614643abac68e473c59b18a54b289f |