Manager
psengine.analyst_notes.note_mgr.AnalystNoteMgr
¶
Manages requests for Recorded Future analyst notes.
PARAMETER | DESCRIPTION |
---|---|
rf_token
|
Recorded Future API token.
TYPE:
|
Source code in psengine/analyst_notes/note_mgr.py
delete
¶
Delete an analyst note.
PARAMETER | DESCRIPTION |
---|---|
note_id
|
The ID of the analyst note to look up.
TYPE:
|
Endpoint
/analystnote/delete/{note_id}
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AnalystNoteDeleteError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
bool
|
True if delete is successful, False otherwise. |
Source code in psengine/analyst_notes/note_mgr.py
fetch_attachment
¶
Get an analyst note attachment.
To work with the attachment is the same regardless of the file extension.
PARAMETER | DESCRIPTION |
---|---|
note_id
|
The ID of the note.
TYPE:
|
Endpoint
/analystnote/attachment/{note_id}
Example
Fetch and save an attachment from an analyst note:
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AnalystNoteAttachmentError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
tuple[bytes, str]
|
A tuple containing the file content (bytes) and the file extension (str). |
Source code in psengine/analyst_notes/note_mgr.py
lookup
¶
lookup(
note_id: str,
tagged_text: bool = False,
serialization: str = 'full',
) -> AnalystNote
Look up an analyst note by ID.
PARAMETER | DESCRIPTION |
---|---|
note_id
|
The ID of the analyst note to look up.
TYPE:
|
tagged_text
|
Add RF IDs to the note entities.
TYPE:
|
serialization
|
The serialization type of the payload.
TYPE:
|
Endpoint
/analystnote/lookup/{note_id}
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AnalystNoteLookupError
|
If API error occurs. |
RETURNS | DESCRIPTION |
---|---|
AnalystNote
|
The requested note. |
Source code in psengine/analyst_notes/note_mgr.py
preview
¶
preview(
title: str,
text: str,
published: Optional[str] = None,
topic: Union[str, list[str], None] = None,
context_entities: Optional[list[str]] = None,
note_entities: Optional[list[str]] = None,
validation_urls: Optional[list[str]] = None,
source: Optional[str] = None,
) -> AnalystNotePreviewOut
Preview of the AnalystNote. It does not create a note; it just returns how the note will look.
PARAMETER | DESCRIPTION |
---|---|
title
|
The title of the note.
TYPE:
|
text
|
The text of the note.
TYPE:
|
published
|
The date when the note was published.
TYPE:
|
topic
|
The topic of the note.
TYPE:
|
context_entities
|
The context entities of the note.
TYPE:
|
note_entities
|
The note entities of the note.
TYPE:
|
validation_urls
|
The validation URLs of the note.
TYPE:
|
source
|
The source of the note.
TYPE:
|
Endpoint
/analystnote/preview
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AnalystNotePreviewRequest
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
AnalystNotePreviewOut
|
The note that will be created. |
Source code in psengine/analyst_notes/note_mgr.py
publish
¶
publish(
title: str,
text: str,
published: Optional[str] = None,
topic: Union[str, list[str], None] = None,
context_entities: Optional[list[str]] = None,
note_entities: Optional[list[str]] = None,
validation_urls: Optional[list[str]] = None,
source: Optional[str] = None,
note_id: Optional[str] = None,
) -> AnalystNotePublishOut
Publish data. This method creates a note and returns its ID.
PARAMETER | DESCRIPTION |
---|---|
title
|
The title of the note.
TYPE:
|
text
|
The text of the note.
TYPE:
|
published
|
The date when the note was published.
TYPE:
|
topic
|
The topic of the note.
TYPE:
|
context_entities
|
The context entities of the note.
TYPE:
|
note_entities
|
The note entities of the note.
TYPE:
|
validation_urls
|
The validation URLs of the note.
TYPE:
|
source
|
The source of the note.
TYPE:
|
note_id
|
The ID of the note. Use if you want to modify an existing note.
TYPE:
|
Endpoint
/analystnote/publish
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AnalystNotePublishError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
AnalystNotePublishOut
|
The published note. |
Source code in psengine/analyst_notes/note_mgr.py
search
¶
search(
published: Optional[str] = None,
entity: Optional[str] = None,
author: Optional[str] = None,
title: Optional[str] = None,
topic: Optional[Union[str, list]] = None,
label: Optional[str] = None,
source: Optional[str] = None,
serialization: Optional[str] = None,
tagged_text: Optional[bool] = None,
max_results: Optional[int] = Field(
ge=1, le=1000, default=DEFAULT_LIMIT
),
notes_per_page: Optional[int] = Field(
ge=1, le=1000, default=NOTES_PER_PAGE
),
) -> list[AnalystNote]
Execute a search for the analyst notes based on the parameters provided. Every parameter that has not been set up will be discarded.
If more than one topic is specified, a search for each topic is executed and the
AnalystNotes
will be deduplicated.
max_results
is the maximum number of references, not notes.
PARAMETER | DESCRIPTION |
---|---|
published
|
Notes published after a date.
TYPE:
|
entity
|
An entity the note refers to, RF ID.
TYPE:
|
author
|
An author of the note, RF ID.
TYPE:
|
title
|
A title of the note.
TYPE:
|
topic
|
A topic of the note, RF ID.
TYPE:
|
label
|
A label of the note, by name.
TYPE:
|
source
|
The source of the note.
TYPE:
|
serialization
|
An entity serializer (id, min, full, raw).
TYPE:
|
tagged_text
|
Should the text contain tags.
TYPE:
|
max_results
|
The maximum number of references (not notes), max 1000.
TYPE:
|
notes_per_page
|
The number of notes for each paged request.
TYPE:
|
Endpoint
/analystnote/search
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AnalystNoteSearchError
|
If API error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[AnalystNote]
|
A list of deduplicated AnalystNote objects. |