Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
note-python/notecard/note.py at main · drrk/note-python · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
drrk
/
note-python
Public
forked from
blues/note-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
note-python
/
notecard
/
note.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
174 lines (148 loc) · 5.05 KB
main
Breadcrumbs
note-python
/
notecard
/
note.py
Copy path
Top
File metadata and controls
Code
Blame
174 lines (148 loc) · 5.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
"""note Fluent API Helper."""
##
# @file note.py
#
# @brief note Fluent API Helper.
#
# @section description Description
# This module contains helper methods for calling note.* Notecard API commands.
# This module is optional and not required for use with the Notecard.
import
notecard
from
.
validators
import
validate_card_object
@
validate_card_object
def
add
(
card
,
file
=
None
,
body
=
None
,
payload
=
None
,
sync
=
None
):
"""Add a Note to a Notefile.
Args:
card (Notecard): The current Notecard object.
file (string): The name of the file.
body (JSON object): A developer-defined tracker ID.
payload (string): An optional base64-encoded string.
sync (bool): Perform an immediate sync after adding.
Returns:
string: The result of the Notecard request.
"""
req
=
{
"req"
:
"note.add"
}
if
file
:
req
[
"file"
]
=
file
if
body
:
req
[
"body"
]
=
body
if
payload
:
req
[
"payload"
]
=
payload
if
sync
is
not
None
:
req
[
"sync"
]
=
sync
return
card
.
Transaction
(
req
)
@
validate_card_object
def
changes
(
card
,
file
=
None
,
tracker
=
None
,
maximum
=
None
,
start
=
None
,
stop
=
None
,
deleted
=
None
,
delete
=
None
):
"""Incrementally retrieve changes within a Notefile.
Args:
card (Notecard): The current Notecard object.
file (string): The name of the file.
tracker (string): A developer-defined tracker ID.
maximum (int): Maximum number of notes to return.
start (bool): Should tracker be reset to the beginning
before a get.
stop (bool): Should tracker be deleted after get.
deleted (bool): Should deleted notes be returned.
delete (bool): Should notes in a response be auto-deleted.
Returns:
string: The result of the Notecard request.
"""
req
=
{
"req"
:
"note.changes"
}
if
file
:
req
[
"file"
]
=
file
if
tracker
:
req
[
"tracker"
]
=
tracker
if
maximum
:
req
[
"max"
]
=
maximum
if
start
is
not
None
:
req
[
"start"
]
=
start
if
stop
is
not
None
:
req
[
"stop"
]
=
stop
if
deleted
is
not
None
:
req
[
"deleted"
]
=
deleted
if
delete
is
not
None
:
req
[
"delete"
]
=
delete
return
card
.
Transaction
(
req
)
@
validate_card_object
def
get
(
card
,
file
=
"data.qi"
,
note_id
=
None
,
delete
=
None
,
deleted
=
None
):
"""Retrieve a note from an inbound or DB Notefile.
Args:
card (Notecard): The current Notecard object.
file (string): The inbound or DB notefile to retrieve a
Notefile from.
note_id (string): (DB files only) The ID of the note to retrieve.
delete (bool): Whether to delete the note after retrieval.
deleted (bool): Whether to allow retrieval of a deleted note.
Returns:
string: The result of the Notecard request.
"""
req
=
{
"req"
:
"note.get"
}
req
[
"file"
]
=
file
if
note_id
:
req
[
"note"
]
=
note_id
if
delete
is
not
None
:
req
[
"delete"
]
=
delete
if
deleted
is
not
None
:
req
[
"deleted"
]
=
deleted
return
card
.
Transaction
(
req
)
@
validate_card_object
def
delete
(
card
,
file
=
None
,
note_id
=
None
):
"""Delete a DB note in a Notefile by its ID.
Args:
card (Notecard): The current Notecard object.
file (string): The file name of the DB notefile.
note_id (string): The id of the note to delete.
Returns:
string: The result of the Notecard request.
"""
req
=
{
"req"
:
"note.delete"
}
if
file
:
req
[
"file"
]
=
file
if
note_id
:
req
[
"note"
]
=
note_id
return
card
.
Transaction
(
req
)
@
validate_card_object
def
update
(
card
,
file
=
None
,
note_id
=
None
,
body
=
None
,
payload
=
None
):
"""Update a note in a DB Notefile by ID.
Args:
card (Notecard): The current Notecard object.
file (string): The file name of the DB notefile.
note_id (string): The id of the note to update.
body (JSON): The JSON object to add to the note.
payload (string): The base64-encoded JSON payload to
add to the note.
Returns:
string: The result of the Notecard request.
"""
req
=
{
"req"
:
"note.update"
}
if
file
:
req
[
"file"
]
=
file
if
note_id
:
req
[
"note"
]
=
note_id
if
body
:
req
[
"body"
]
=
body
if
payload
:
req
[
"payload"
]
=
payload
return
card
.
Transaction
(
req
)
@
validate_card_object
def
template
(
card
,
file
=
None
,
body
=
None
,
length
=
None
):
"""Create a template for new Notes in a Notefile.
Args:
card (Notecard): The current Notecard object.
file (string): The file name of the notefile.
body (JSON): A sample JSON body that specifies field names and
values as "hints" for the data type.
length (int): If provided, the maximum length of a payload that
can be sent in Notes for the template Notefile.
Returns:
string: The result of the Notecard request.
"""
req
=
{
"req"
:
"note.template"
}
if
file
:
req
[
"file"
]
=
file
if
body
:
req
[
"body"
]
=
body
if
length
:
req
[
"length"
]
=
length
return
card
.
Transaction
(
req
)
You can’t perform that action at this time.