weallwegot / conversation-analytics

find out all the important statistics and breakdowns of your iphone conversations.
4 stars 2 forks source link

port to python 3.x #14

Open weallwegot opened 7 years ago

weallwegot commented 7 years ago

https://docs.python.org/3/howto/pyporting.html

datetime.datetime(2017,1,1).timestamp() will return epoch time.... i need that. additionally the shit with wide vs narrow build for unicode regular expressions will be handled. I should have started in python 3.x but...

temitope commented 7 years ago

Is there no conversion code or lib utility to help get epoch time in the version of python your currently using? Generally a good idea to upgrade but mindful of all the places it might break code you already wrote. Hopefully not many or any.

weallwegot commented 7 years ago

there is a library called matplotlib but it uses some other date to number system that goes from year 0 and is one number for each day. id rather use UNIX time because its standard and if i end up doing visualization in highcharts its supported that way. there are other ways to do it yea, but this is easiest with the datetime objects im using.

secondly the biggest and best change would be handling of unicode which is super central to the emoji detection things i think the most complex part of the project this commit is the regex needed for 2.7 and ithink its equivalent in 3.x is commented above (very ugly in 2.7) b1dba2b3a57bda5df6eaa50e9c1f0d6891d4214f

this commit is related to emojis and skin tones and part of why its really important to get it right and probably simplify if possible. more reason to upgrade ab49349b49436deb892f29cb5f7c662d7e3a0ff7

weallwegot commented 7 years ago

the regex in 3.x : [\U0001d300-\U0001d356] the equivalent in 2.7 : (\ud838[\udc50-\udfff])|([\ud839-\ud83d][\udc00-\udfff])|(\ud83e[\udc00-\udfbf])|([\udc50-\udfff]\ud838)|([\udc00-\udfff][\ud839-\ud83d])|([\udc00-\udfbf]\ud83e)