Skip to main content

Type-safe python SDK for HackMD developer

Project description

HackMD Python SDK

License: MIT PRs Welcome Python Version

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

MIT

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

hackmd-sdk-python-0.2.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

hackmd_sdk_python-0.2.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page