digitalsleuth / time_decode

A timestamp and date decoder written for python 3
https://digitalsleuth.gitbook.io/time-decode-documentation/
MIT License
33 stars 8 forks source link

Some code examples ? #9

Closed Augmaster closed 8 months ago

Augmaster commented 1 year ago

Hi, your project is fantastic and can really help, but as a junior-intermediary developer aspiring data scientist I'm looking for code example to discover how to use your package. Would it be possible to have dummy script with few lines of code on how to use the module ? Thank you so much

have a nice day:)

digitalsleuth commented 1 year ago

Hi @Augmaster , were you looking to use this tool as an import into a python script? Currently, I haven't quite designed time-decode to be an importable module, but I have been considering on making it such.

Can you give me an idea of what kinds of things you might be looking to use the module for so I can consider those while I develop the library?

Augmaster commented 1 year ago

Hey, yes i'm looking to import the python script, like from time-decode import NsDate-decoder

or something like this that would allow me to convert any type of dates to a Unix time or something more user friendly Thank you for such a fast answer :)

digitalsleuth commented 1 year ago

Anytime, let me review and get back to you! I can't promise it'll be as quick a response, but I will make a solid effort to make it as timely as I can. :)

digitalsleuth commented 1 year ago

Hi @Augmaster , I haven't forgotten about this request, and I believe I'm almost finished, but still need to do some final testing. It should be ready in a day or two, as a new version, with the ability to import and use the module as a separate library.

Cheers!

Augmaster commented 1 year ago

Oh really nice from you, thanks a lot for the time you're taking for that :) Have a nice day

digitalsleuth commented 1 year ago

Hi @Augmaster , I just released the newest version of time-decode @ version 6.0. It's available on pypi, and the wheel is available under the Releases section.

I'll update the README in a day or two with some examples, but for now you can use the following example to get started:

from time_decode import time_decode as td

>>> biome_ts, biome_printout, biome_colour_printout, biome_reason = td.from_biomehex('41c4fd901d6d6d44')
('2023-04-27 21:27:22.854897', 'Apple Biome hex time: 2023-04-27 21:27:22.854897 UTC', '\x1b[1;31mApple Biome hex time:\t\t2023-04-27 21:27:22.854897 UTC\x1b[1;m', 'Apple Biome Hex value is 8 bytes (16 chars) long')
>>> biome_ts
'2023-04-27 21:27:22.854897'

Cheers!

Augmaster commented 1 year ago

Thank you very much, it's appreciated.

Have a great rest of your day, and amazing work ;)