Skip to main content

Table of Contents

What's this

python-HackMD is a Python interface for HackMD API. Read the full docs on ReadTheDocs.

Getting Started

Prerequisites

Installation

pip install python-HackMD

Basic Usage

Let's create an API object before everything starts.

from PyHackMD import API
api = API('<token>')

User API

  1. Get user information
data = api.get_me()
print(data)

User Notes API

  1. Get a list of notes in the user's workspace
data = api.get_notes()
print(data)
  1. Get a note
# note_id can be obtained using get_notes()
data = api.get_note('<note_id>')
print(data)
  1. Create a note
data = api.create_note(
            title='New Note',
            content='blablabla',
            read_perm='signed_in',
            write_perm='owner',
            comment_perm='signed_in_users')
print(data)
  1. Update a note
# note_id can be obtained using get_notes()
data = api.update_note(
            '<note_id>',
            content='blablabla',
            read_perm='signed_in',
            write_perm='owner',
            comment_perm='signed_in_users')
print(data)
  1. Delete a note
# note_id can be obtained using get_notes()
data = api.delete_note('<note_id>')
print(data)
  1. Get a history of read notes
data = api.get_read_history()
print(data)

Teams API

  1. Get a list of the teams to which the user has permission
data = api.get_teams()
print(data)

Team Notes API

  1. Get a list of notes in a Team's workspace
# team_path can be obtained using get_teams()
data = api.get_team_notes('<team_path>')
print(data)
  1. Get a note in a Team's workspace
# note_id can be obtained using get_team_notes()
data = api.get_team_note('<note_id>')
print(data)
  1. Create a note in a Team workspace
# team_path can be obtained using get_teams()
data = api.create_team_note(
            '<team_path>'
            title='New Note',
            content='blablabla',
            read_perm='signed_in',
            write_perm='owner',
            comment_perm='signed_in_users')
print(data)
  1. Update a note in a Team's workspace
# team_path can be obtained using get_teams()
# note_id can be obtained using get_team_notes()
data = api.update_team_note(
            '<team_path>', '<note_id>',
            content='blablabla',
            read_perm='signed_in',
            write_perm='owner',
            comment_perm='signed_in_users')
print(data)
  1. Delete a note in a Team's workspace
# team_path can be obtained using get_teams()
# note_id can be obtained using get_team_notes()
data = api.delete_team_note('<team_path>', '<note_id>')
print(data)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-HackMD-1.0.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

python_HackMD-1.0.3-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file python-HackMD-1.0.3.tar.gz.

File metadata

  • Download URL: python-HackMD-1.0.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for python-HackMD-1.0.3.tar.gz
Algorithm Hash digest
SHA256 265c3672da12fc79ce5e2051b46b40760228f92bc36329650b2085afc4188574
MD5 7cf5c8b8c374432ce59529d50f490292
BLAKE2b-256 a0deedccfc5f5f57fc27fbfdbb8d368920a6791e3c38a92cdd093f2f01dfaca4

See more details on using hashes here.

File details

Details for the file python_HackMD-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: python_HackMD-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for python_HackMD-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aa00ca0186d39e0db875b4d3e93dac23e963c0f3dc7e978efd8c4aa3a518fe14
MD5 b2ceab12c6d275f11828715929a1c304
BLAKE2b-256 7afeca2c70c65cbc0a4ca42d1cc5c72cfaf359ffe15a9edf71446419ac336ec0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 files

1.0.1

2 files

Supported by

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