TruxtonEXIF
This class lets you add to the EXIF table in Truxton.
Contents
- 1 Attributes and Methods
- 1.1 altitude
- 1.2 altitude
- 1.3 altitudeoffset
- 1.4 bodyserialnumber
- 1.5 bodyserialnumberoffset
- 1.6 devicetime
- 1.7 devicetimeoffset
- 1.8 fileid
- 1.9 focallength
- 1.10 focallengthoffset
- 1.11 gpstime
- 1.12 gpstimeoffset
- 1.13 heading
- 1.14 headingoffset
- 1.15 id
- 1.16 latitude
- 1.17 latitudeoffset
- 1.18 lensserialnumber
- 1.19 lensserialnumberoffset
- 1.20 longitude
- 1.21 longitudeoffset
- 1.22 make
- 1.23 makeoffset
- 1.24 mediaid
- 1.25 model
- 1.26 modeloffset
- 1.27 save()
- 1.28 shuttercount
- 1.29 shuttercountoffset
- 1.30 tag(tag, reason, origin)
- 1.31 thumbnaillength
- 1.32 thumbnaillengthoffset
- 1.33 thumbnailoffset
- 1.34 thumbnailoffsetoffset
- 2 Sample
Attributes and Methods
altitude
altitude
altitudeoffset
bodyserialnumber
bodyserialnumberoffset
devicetime
devicetimeoffset
fileid
The GUID of the file this artifact came from.
This corresponds to the FileID column of the Entity table.
focallength
focallengthoffset
gpstime
gpstimeoffset
heading
headingoffset
id
This is the GUID of the record.
It becomes non-zero after save() has been called.
This corresponds to the ID column of the Entity table.
latitude
latitudeoffset
lensserialnumber
lensserialnumberoffset
longitude
longitudeoffset
make
makeoffset
mediaid
This is the GUID of the media this artifact came from.
This corresponds to the MediaID column of the Entity table.
model
modeloffset
save()
This will commit the information to the Entity table.
It will return True if the record was saved to the database, False if there was an error.
shuttercount
shuttercountoffset
tag(tag, reason, origin)
This creates a tag associated with this camera information in Truxton.
The tag parameter is a short, one or two word, bit of text that will be displayed in the UI.
The reason a sentence explaining why this camera information was tagged.
The origin is either TAG_ORIGIN_AUTOMATIC (1) or TAG_ORIGIN_HUMAN (2).
It will return
True if the tag was associated with the camera information, False on failure.
thumbnaillength
thumbnaillengthoffset
thumbnailoffset
thumbnailoffsetoffset
Sample
import truxton
import shutil
from datetime import datetime
from calendar import timegm
from pathlib import Path
EPOCH_AS_FILETIME = 116444736000000000
HUNDREDS_OF_NANOSECONDS = 10000000
EVENT_TYPE_FBI = 20001
def date_to_filetime(dt):
return EPOCH_AS_FILETIME + (timegm(dt.timetuple()) * HUNDREDS_OF_NANOSECONDS)
def create_event_type(t, id, name):
event_type = t.neweventtype()
event_type.id = id
event_type.name = name
event_type.save()
def add_file(parent_truxton_file, filename):
source_file = open(filename, "rb")
child = parent_truxton_file.newchild()
child.name = Path(filename).name
shutil.copyfileobj(source_file, child)
source_file.close()
child.save()
return child
def add_event(parent_file, start, end, title, description, type):
event = parent_file.newevent()
event.start = date_to_filetime(datetime.fromisoformat(start))
event.end = date_to_filetime(datetime.fromisoformat(end))
event.title = title
event.description = description
event.type = type
event.save()
return event
def add_media(t):
media = t.newmedia()
media.name = "Public Documents"
media.description = "Publicly available documents"
media.case = "DC-SNAFU-2016.2020"
media.evidencebag = "EV-0937459386623-a"
media.originator = "Jeffrey Jensen"
media.latitude = 38.897661
media.longitude = -77.036458
media.type = truxton.MEDIA_TYPE_LOGICAL_FILES
if media.save():
print("Media saved")
else:
print("Media not saved")
return media
def add_ec(parent_file ):
child_file = add_file(parent_file, "JW-v-DOJ-reply-02743.pdf")
url = child_file.newurl()
url.url = "https://www.judicialwatch.org/documents/jw-v-doj-reply-02743/"
url.localfilename = "JW-v-DOJ-reply-02743.pdf"
url.type = truxton.URL_TYPE_FIREFOX
url.method = truxton.URL_METHOD_TYPE_CLICKED_ON_A_LINK
url.format = truxton.URL_FORMAT_ASCII
url.when = date_to_filetime(datetime.fromisoformat("2020-05-20T00:00:00-05:00"))
url.save()
add_event( child_file, "2016-07-31T12:00:00-05:00", "2016-07-31T12:00:00-05:00", "Crossfire Hurricane Created", "At FBI HQ", EVENT_TYPE_FBI )
add_event( child_file, "2016-07-27T12:00:00-05:00", "2016-07-27T12:00:00-05:00", "Legat called needing to meet US ambassador", "In London", EVENT_TYPE_FBI )
add_event( child_file, "2016-07-29T12:00:00-05:00", "2016-07-29T12:00:00-05:00", "FBI Receives Downer Info from Legat", "Probably legat London", EVENT_TYPE_FBI )
def main():
t = truxton.create()
create_event_type(t, EVENT_TYPE_FBI, "FBI Actions" )
media = add_media(t)
root_file = media.addroot()
root_file.save()
add_ec(root_file)
if __name__ == "__main__":
main()