Table of Contents
What's this
python-HackMD is a Python interface for HackMD API. Read the full docs on ReadTheDocs.
Getting Started
Prerequisites
- Python 3.6+
- HackMD API token (How to create a token)
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
- Get user information
data = api.get_me()
print(data)
User Notes API
- Get a list of notes in the user's workspace
data = api.get_notes()
print(data)
- Get a note
# note_id can be obtained using get_notes()
data = api.get_note('<note_id>')
print(data)
- 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)
- 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)
- Delete a note
# note_id can be obtained using get_notes()
data = api.delete_note('<note_id>')
print(data)
- Get a history of read notes
data = api.get_read_history()
print(data)
Teams API
- Get a list of the teams to which the user has permission
data = api.get_teams()
print(data)
Team Notes API
- 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)
- 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)
- 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)
- 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)
- 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)
Metadata
Release files for python-HackMD 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-HackMD-1.0.3.tar.gz | 3.1 kB | Without provenance | Details for python-HackMD-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_HackMD-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for python_HackMD-1.0.3-py3-none-any.whl |
Total release size: 5.9 kB
Release files / python-HackMD-1.0.3.tar.gz
| Download URL | python-HackMD-1.0.3.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
265c3672da12fc79ce5e2051b46b40760228f92bc36329650b2085afc4188574
|
|
BLAKE2b-256 checksum How to use checksums |
a0deedccfc5f5f57fc27fbfdbb8d368920a6791e3c38a92cdd093f2f01dfaca4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Release files / python_HackMD-1.0.3-py3-none-any.whl
| Download URL | python_HackMD-1.0.3-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa00ca0186d39e0db875b4d3e93dac23e963c0f3dc7e978efd8c4aa3a518fe14
|
|
BLAKE2b-256 checksum How to use checksums |
7afeca2c70c65cbc0a4ca42d1cc5c72cfaf359ffe15a9edf71446419ac336ec0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Security for python-HackMD 1.0.3
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.