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

# 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.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hackmd_sdk_python-0.2.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file hackmd-sdk-python-0.2.0.tar.gz.

File metadata

  • Download URL: hackmd-sdk-python-0.2.0.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

Hashes for hackmd-sdk-python-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7262dad93106640e0337b37ad3c69fe211d5b06d839149fb93232568227b8d6e
MD5 fa00418f78383010732e8458fdff2d9e
BLAKE2b-256 5cdb52105c290bce8eb20d3a8229ec93d1f10eb7cf942092d41f9335699f42ca

See more details on using hashes here.

File details

Details for the file hackmd_sdk_python-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hackmd_sdk_python-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfea99d5eea63f460f670afa2ceb435c7bb7e2edf0ba35d52c16c574e480b487
MD5 c07d3b846e529338979d238fe2ac2c71
BLAKE2b-256 93d7cfe378e480d84db84a0139531ce2f936151096683e5df90948785210a7db

See more details on using hashes here.

Supported by

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