{ "info": { "author": "Martin van Wingerden", "author_email": "martinvw@mtin.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: System :: Filesystems", "Topic :: Terminals", "Topic :: Utilities" ], "description": "=============================\nWelcome to the Epoch Analyzer\n=============================\n\n.. image:: https://travis-ci.org/martinvw/epoch-analyzer.png?branch=master\n :target: https://travis-ci.org/martinvw/epoch-analyzer\n\n.. image:: https://coveralls.io/repos/martinvw/epoch-analyzer/badge.png?branch=master\n :target: https://coveralls.io/r/martinvw/epoch-analyzer?branch=master\n\nA python module to analyze numbers to determine on which epoch they might be based and in what unit they might be expressed.\n\nInstallation\n------------\n\n1. Install using pip:\n\n ``pip install epoch_analyzer``\n\n for windows:\n\n ``py -m pip install epoch_analyzer``\n\n Alternatively, you can download or clone this repo and call ``pip install -e .``.\n\nUsage in Python\n---------------\n\nImport the EpochTester from the package epoch_analyzer\n\n``from epoch_analyzer import EpochTester``\n\nIf you desire you can pass a min_date and max_date which are used for reference.\n\nGiven the resulting object you can call test or convert, for either testing numbers for a probable format or (batch) converting lists of numbers to dates.\n\nUsage EpochTester.test\n----------------------\n\nYou can pass one number, an iterable list of numbers (for example a counter) to this method.\n\nFor each number one test conversion is performed, it then check which format matches most of the values, a counter object is returned. By calling most_common on that object, the items can be iterated in order starting at the most likely options.\n\n\n.. code-block:: python\n\n from epoch_analyzer import EpochTester\n\n tester = EpochTester()\n results = tester.test({12345435, 2999663906})\n\n for match, occurrence in results.most_common():\n print(\"\\t%s:\\t%d%%\" % (match, occurrence))\n\n\nUsage EpochTester.convert\n-------------------------\n\nIf you have an unknown type and want conversion to all plausible options you can use this method. If you already know the format its better to fetch a convertor and use that, see alse the option described below.\n\n.. code-block:: python\n\n from epoch_analyzer import EpochTester\n\n tester = EpochTester()\n results = tester.convert({12345435, 2999663906})\n\n for input, matches in results.items():\n print(\"%d: #%d matches\" % (input, len(matches)))\n\n for label, result in matches:\n print(\"\\t%s:\\t%s%%\" % (label, result))\n\nOutput:\n\n.. code-block:: sh\n\n 2999663906: #1 matches\n \t 4-Bytes bit-based timestamp since 1970:\t2014-11-05 19:52:34%\n 12345435: #0 matches\n\n\nUsage for specific conversions\n------------------------------\n\nIf you know with which epoch you are working and you are converting single numbers than the conversion is quite simple. In that case you don't have to use the convert method but you just request the specific convertor and use that, see the following example.\n\n.. code-block:: python\n\n from epoch_analyzer import EpochTester\n\n convertor = EpochTester().get_convertor('4-Bytes bit-based timestamp since 1970')\n\n print(convertor.convert_to_date(2999663906)) # prints '2014-11-05 19:52:34'\n\n\nUsage from the command line\n---------------------------\n\nWhen the module is correctly installed, the command `epoch` should be available from your path. There are a lot of options, which are listed when calling the command without any arguments.\n\nSome examples:\n\nJust convert a single value:\n\n``epoch 1394543556``\n\nOutput:\n\n.. code-block:: sh\n\n For input 1394543556:\n Number Of Seconds Since Unix Epoch (2014-03-11 13:12:36)\n\n\nConvert a list of timestamp from a file and output them to a file as unix timestamp.\n\n``epoch -f input.txt -u > output-timestamps.txt``\n\nMake a summary of the matches from a list of timestamps from a file.\n\n``epoch -f input.txt --summary``\n\nOutput:\n\n.. code-block:: sh\n\n Summary for 5 inputs:\n \t1.\tNumber Of Seconds Since Unix Epoch:\t40%\n \t2.\tNumber Of Minutes Since Mac OSX Epoch:\t40%\n \t3.\tNumber Of Mili Seconds Since Unix Epoch:\t20%\n\nSupply a minimum (which is in this case out-of-range for this unixtime):\n\n``epoch --min 2014-12-01 1394543556``\n\nOutput:\n\n.. code-block:: sh\n\n For input 1394543556:\n No matching pattern was found\n\nA space separated hexadecimal input is supported:\n\n``epoch \"aa bb\" --hex``\n\nOutput (Note that big and little endian are both tested):\n\n.. code-block:: sh\n\n For input 48042:\n \tNo matching pattern was found\n For input 43707:\n \tNo matching pattern was found\n\n\nUsage from the command line: scanning binary files\n--------------------------------------------------\n\nWhen the module is correctly installed (note that termcolor is a prerequisite), the command `epoch_scan` should be available from your path. There are a lot of options, which are listed when calling the command without any arguments.\n\nThe table width is required to make columns and spot patterns. If your data has a fixed table width its most of the time easy to detect by just resizing your hex editor until you see clear columns of repeating or similair data being displayed. Compare the following two examples:\n\n.. code-block::\n\n \u00aa..!B....tI.v..:r.#..gd.....l...._..2..9D.a..T..d...\u00aa..!B ........\n .w\u00aa..!B....tI.w..9r.#..gd.....l...._..2..9D.a..T..d...\u00aa..!B ......\n ...w\u00aa..!B....tI.w..9r.#..gd.....l...._..2..9D.a..T..d...\u00aa..!B ....\n .....w\u00aa..!B....tI.w..9q.\"..id.....l...._..2..9D.a..T..d...\u00aa..!B ..\n .......w\u00aa..!B....tI.w..9q.\"..id.....l...._..2..9D.a..T..d...\u00aa..!B \n .........w\n \n.. code-block::\n\n \u00aa..!B....tI.v..:r.#..gd.....l...._..2..9D.a..T..d...\u00aa..!B .........w\n \u00aa..!B....tI.w..9r.#..gd.....l...._..2..9D.a..T..d...\u00aa..!B .........w\n \u00aa..!B....tI.w..9r.#..gd.....l...._..2..9D.a..T..d...\u00aa..!B .........w\n \u00aa..!B....tI.w..9q.\"..id.....l...._..2..9D.a..T..d...\u00aa..!B .........w\n \u00aa..!B....tI.w..9q.\"..id.....l...._..2..9D.a..T..d...\u00aa..!B .........w\n\nSome examples:\n\nScan for epoch values in the file above:\n\n``epoch_scan -t 44 raw.log``\n\nOutput:\n\n.. code-block:: sh\n\n Sample picked from offset: 4\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (big end.) 22282752 => 1970-05-10 00:08:00 4-Bytes bit-based timestamp since 1970 [0.900000]\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (little end.) 1677722196 => None 4-Bytes bit-based timestamp since 1970 [0.900000]\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (little end.) -1441202176 => 2012-08-12 16:00:00 4-Bytes bit-based timestamp since 1970 [0.900000]\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (little end.) 1109458944 => 1986-08-16 16:00:00 4-Bytes bit-based timestamp since 1970 [0.900000]\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (big end.) -1441791967 => 2012-08-08 00:00:33 4-Bytes bit-based timestamp since 1970 [0.900000]\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (little end.) 1109458960 => 1986-08-16 16:00:16 4-Bytes bit-based timestamp since 1970 [0.900000]\n 44036102 01540200 64000019 AA000021 42200005 00000000 00000077 AA100021 42100001 07744901 77000539 (little end.) 117506064 => None 4-Bytes bit-based timestamp since 1970 [0.900000]\n \nThe outputs shows a random sample from the file. Each match is highlighted (blue for big endian, green for little endian). The bytes are shown in capital hex and displayed in groups of 4 bytes. To aid the interpretation of the results, both the numeric value and the converted value are shown for the matching format.\n\nOther options which might be helpfull are:\n\n* using a fixed sample -s\n* defining a --min or --max if you expect a specific period\n* limit the number of items to process -c", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/martinvw/epoch-analyzer/tarball/v0.4", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/martinvw/epoch-analyzer", "keywords": "datetime,timestamp,epoch", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "epoch_analyzer", "package_url": "https://pypi.org/project/epoch_analyzer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/epoch_analyzer/", "project_urls": { "Download": "https://github.com/martinvw/epoch-analyzer/tarball/v0.4", "Homepage": "https://github.com/martinvw/epoch-analyzer" }, "release_url": "https://pypi.org/project/epoch_analyzer/0.4/", "requires_dist": null, "requires_python": null, "summary": "Utility detect probable date/time formats given a numeric input.", "version": "0.4" }, "last_serial": 2070170, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "17e4c5d1ee72b381633bd95d8ad2bc4b", "sha256": "1b41a12add570a7b4f849095dddfd1a548aa8ae0882158ec2641ac04679a98e4" }, "downloads": -1, "filename": "epoch_analyzer-0.1.tar.gz", "has_sig": false, "md5_digest": "17e4c5d1ee72b381633bd95d8ad2bc4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6323, "upload_time": "2015-04-28T12:50:05", "url": "https://files.pythonhosted.org/packages/2d/1d/409805d93b14bc1a84456170bb89e637739694e4fd0c8ee89056d808a477/epoch_analyzer-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f2c16e2a9e9f9dc489fd9ae755b25409", "sha256": "0c7464ac49a2b7102d537e4b00fa2a369b10187e0dbf668f60a9b6333001fe83" }, "downloads": -1, "filename": "epoch-analyzer-0.2.tar.gz", "has_sig": false, "md5_digest": "f2c16e2a9e9f9dc489fd9ae755b25409", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7383, "upload_time": "2015-06-08T09:16:24", "url": "https://files.pythonhosted.org/packages/52/23/5c398d271d54eced0e0aed605c26c2d6c7b5fbde0bf445080834d4f25e4e/epoch-analyzer-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "c0529e52391f9a02482e9511323489b1", "sha256": "a7c7eb478be2e273aa2e9a6c2268ab0d6f2b17c2af5fb8ff3c8ed66ecfff0349" }, "downloads": -1, "filename": "epoch_analyzer-0.3.tar.gz", "has_sig": false, "md5_digest": "c0529e52391f9a02482e9511323489b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8988, "upload_time": "2015-06-17T07:53:20", "url": "https://files.pythonhosted.org/packages/ec/41/eb347b74def4d835907af98f46397aeede4b925565bf0c6f08d71d67625d/epoch_analyzer-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "c86d85b51121ac819c2dd27ba219524d", "sha256": "42f9179666f087df6b8afbf2f04a41626f2630797278804447c02d8a303affbe" }, "downloads": -1, "filename": "epoch_analyzer-0.4.tar.gz", "has_sig": false, "md5_digest": "c86d85b51121ac819c2dd27ba219524d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12145, "upload_time": "2016-04-18T20:02:19", "url": "https://files.pythonhosted.org/packages/51/5a/aea0eb847362a74cad9fb72a6e36868e93a2d3235786ba242e7a62e37e82/epoch_analyzer-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c86d85b51121ac819c2dd27ba219524d", "sha256": "42f9179666f087df6b8afbf2f04a41626f2630797278804447c02d8a303affbe" }, "downloads": -1, "filename": "epoch_analyzer-0.4.tar.gz", "has_sig": false, "md5_digest": "c86d85b51121ac819c2dd27ba219524d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12145, "upload_time": "2016-04-18T20:02:19", "url": "https://files.pythonhosted.org/packages/51/5a/aea0eb847362a74cad9fb72a6e36868e93a2d3235786ba242e7a62e37e82/epoch_analyzer-0.4.tar.gz" } ] }