dateiendifferenz


Namedateiendifferenz JSON
Version 0.12 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/dateiendifferenz
Summarytailored for handling file parsing and encoding conversion
upload_time2024-01-01 23:29:14
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords parsing lowlevel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
### Wrapper for stringsext and some other stuff

### Tested against Windows 10 / Python 3.11 / Anaconda 

### Wrapper for stringsext and some other stuff

## Overview:


### pip install dateiendifferenz

stringsext https://github.com/getreu/stringsext is a versatile library designed to facilitate text processing tasks, especially tailored for handling file parsing and encoding conversion. By leveraging this library, developers can effortlessly parse files, transform content into various encodings, and optimize text-based operations.

## Key Features:

File Parsing: With stringsext, parsing both file paths and byte content is streamlined, ensuring seamless data extraction and manipulation.

## Multi-Encoding Support: 

The library boasts extensive support for multiple encoding formats, including but not limited to:

UTF-16BE
UTF-16LE
UTF-8
ISO-8859-1
ISO-8859-2
ISO-8859-3
Windows-1252


```python

"""
    Parse a specified file or content utilizing the external tool 'stringsext' and save the parsed content in multiple encodings.

    This function uses 'stringsext' (https://github.com/getreu/stringsext) to process the input file or content.
    It provides flexibility in specifying various parameters like encoding, block processing, and output directory.

    Args:
        file2parse (str or bytes): The file path or content that needs to be parsed.
        stringsextpath (str, optional): Path to the 'stringsext' executable. Defaults to 'stringsext.exe'.
        blocks_in_one_line (int, optional): Number of blocks to process in a single line. Defaults to 64.
        output_encoding (str, optional): Encoding type for the output files. Defaults to 'Latin'.
        min_chars (int, optional): Minimum number of characters required for processing. Defaults to 64.
        outputfolder (str, optional): Directory where the parsed files will be saved. Defaults to the working directory.
        save_as (tuple, optional): Tuple of encoding formats to save the parsed content. Defaults to multiple common encodings.
        wait (bool, optional): If True, the function will wait for all subprocesses to complete before returning. Defaults to True.

    Returns:
        list: A list containing commands executed and associated subprocess objects created during the parsing process.

from dateiendifferenz import parsedtxt2df,parsetext
allscrapedfiles = [
	r"C:\testUTF-16LE.txt",
	r"C:\testUTF-16BE.txt",

	r"C:\testwindows-1252.txt",
	r"C:\testISO-8859-3.txt",
	r"C:\testISO-8859-2.txt",
	r"C:\testISO-8859-1.txt",
	r"C:\testUTF-8.txt",

]
outputfolder='c:\\outputparsingtestx'
stringsext=r"C:\Users\hansc\.conda\envs\dfdir\stringsext.exe"
filetoparse=r"C:\WINDOWS\system32\cmd.exe"
allcmds = parsetext(file2parse=filetoparse, stringsextpath=stringsext,
					blocks_in_one_line=64, output_encoding='Latin', min_chars=64, outputfolder=outputfolder,
					save_as=(
						"UTF-16BE",
						"UTF-16LE",
						"UTF-8",
						"ISO-8859-1",
						"ISO-8859-2",
						"ISO-8859-3",
						"windows-1252",), wait=True)

df=parsedtxt2df([x[1] for x in allcmds], )


print(df[:5].to_string())
  aa_direction  aa_address aa_continues                                                           aa_payload  aa_group_number                   aa_file                                                                                      aa_whole_string
0         b'<'      255360         b' '  b'<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersi'                0  c:\OU3AF1~1\204D3D~1.TXT                         b'<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">'
1         b'>'      255360         b'+'                                                         b'on="1.0">'                0  c:\OU3AF1~1\204D3D~1.TXT                         b'<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">'
2         b'<'      256000         b' '  b'        <dpiAware  xmlns="http://schemas.microsoft.com/SMI/2005/'                1  c:\OU3AF1~1\204D3D~1.TXT  b'        <dpiAware  xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>'
3         b'>'      256000         b'+'                                                           b'Windows'                1  c:\OU3AF1~1\204D3D~1.TXT  b'        <dpiAware  xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>'
4         b' '      256128         b'+'                                         b'Settings">true</dpiAware>'                1  c:\OU3AF1~1\204D3D~1.TXT  b'        <dpiAware  xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>'


```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/dateiendifferenz",
    "name": "dateiendifferenz",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "parsing,lowlevel",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ae/db/7919953ae5f6d545890bfdfdeab7614fe4a5661beb566b91302e72703001/dateiendifferenz-0.12.tar.gz",
    "platform": null,
    "description": "\r\n### Wrapper for stringsext and some other stuff\r\n\r\n### Tested against Windows 10 / Python 3.11 / Anaconda \r\n\r\n### Wrapper for stringsext and some other stuff\r\n\r\n## Overview:\r\n\r\n\r\n### pip install dateiendifferenz\r\n\r\nstringsext https://github.com/getreu/stringsext is a versatile library designed to facilitate text processing tasks, especially tailored for handling file parsing and encoding conversion. By leveraging this library, developers can effortlessly parse files, transform content into various encodings, and optimize text-based operations.\r\n\r\n## Key Features:\r\n\r\nFile Parsing: With stringsext, parsing both file paths and byte content is streamlined, ensuring seamless data extraction and manipulation.\r\n\r\n## Multi-Encoding Support: \r\n\r\nThe library boasts extensive support for multiple encoding formats, including but not limited to:\r\n\r\nUTF-16BE\r\nUTF-16LE\r\nUTF-8\r\nISO-8859-1\r\nISO-8859-2\r\nISO-8859-3\r\nWindows-1252\r\n\r\n\r\n```python\r\n\r\n\"\"\"\r\n    Parse a specified file or content utilizing the external tool 'stringsext' and save the parsed content in multiple encodings.\r\n\r\n    This function uses 'stringsext' (https://github.com/getreu/stringsext) to process the input file or content.\r\n    It provides flexibility in specifying various parameters like encoding, block processing, and output directory.\r\n\r\n    Args:\r\n        file2parse (str or bytes): The file path or content that needs to be parsed.\r\n        stringsextpath (str, optional): Path to the 'stringsext' executable. Defaults to 'stringsext.exe'.\r\n        blocks_in_one_line (int, optional): Number of blocks to process in a single line. Defaults to 64.\r\n        output_encoding (str, optional): Encoding type for the output files. Defaults to 'Latin'.\r\n        min_chars (int, optional): Minimum number of characters required for processing. Defaults to 64.\r\n        outputfolder (str, optional): Directory where the parsed files will be saved. Defaults to the working directory.\r\n        save_as (tuple, optional): Tuple of encoding formats to save the parsed content. Defaults to multiple common encodings.\r\n        wait (bool, optional): If True, the function will wait for all subprocesses to complete before returning. Defaults to True.\r\n\r\n    Returns:\r\n        list: A list containing commands executed and associated subprocess objects created during the parsing process.\r\n\r\nfrom dateiendifferenz import parsedtxt2df,parsetext\r\nallscrapedfiles = [\r\n\tr\"C:\\testUTF-16LE.txt\",\r\n\tr\"C:\\testUTF-16BE.txt\",\r\n\r\n\tr\"C:\\testwindows-1252.txt\",\r\n\tr\"C:\\testISO-8859-3.txt\",\r\n\tr\"C:\\testISO-8859-2.txt\",\r\n\tr\"C:\\testISO-8859-1.txt\",\r\n\tr\"C:\\testUTF-8.txt\",\r\n\r\n]\r\noutputfolder='c:\\\\outputparsingtestx'\r\nstringsext=r\"C:\\Users\\hansc\\.conda\\envs\\dfdir\\stringsext.exe\"\r\nfiletoparse=r\"C:\\WINDOWS\\system32\\cmd.exe\"\r\nallcmds = parsetext(file2parse=filetoparse, stringsextpath=stringsext,\r\n\t\t\t\t\tblocks_in_one_line=64, output_encoding='Latin', min_chars=64, outputfolder=outputfolder,\r\n\t\t\t\t\tsave_as=(\r\n\t\t\t\t\t\t\"UTF-16BE\",\r\n\t\t\t\t\t\t\"UTF-16LE\",\r\n\t\t\t\t\t\t\"UTF-8\",\r\n\t\t\t\t\t\t\"ISO-8859-1\",\r\n\t\t\t\t\t\t\"ISO-8859-2\",\r\n\t\t\t\t\t\t\"ISO-8859-3\",\r\n\t\t\t\t\t\t\"windows-1252\",), wait=True)\r\n\r\ndf=parsedtxt2df([x[1] for x in allcmds], )\r\n\r\n\r\nprint(df[:5].to_string())\r\n  aa_direction  aa_address aa_continues                                                           aa_payload  aa_group_number                   aa_file                                                                                      aa_whole_string\r\n0         b'<'      255360         b' '  b'<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersi'                0  c:\\OU3AF1~1\\204D3D~1.TXT                         b'<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">'\r\n1         b'>'      255360         b'+'                                                         b'on=\"1.0\">'                0  c:\\OU3AF1~1\\204D3D~1.TXT                         b'<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">'\r\n2         b'<'      256000         b' '  b'        <dpiAware  xmlns=\"http://schemas.microsoft.com/SMI/2005/'                1  c:\\OU3AF1~1\\204D3D~1.TXT  b'        <dpiAware  xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>'\r\n3         b'>'      256000         b'+'                                                           b'Windows'                1  c:\\OU3AF1~1\\204D3D~1.TXT  b'        <dpiAware  xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>'\r\n4         b' '      256128         b'+'                                         b'Settings\">true</dpiAware>'                1  c:\\OU3AF1~1\\204D3D~1.TXT  b'        <dpiAware  xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>'\r\n\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "tailored for handling file parsing and encoding conversion",
    "version": "0.12",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/dateiendifferenz"
    },
    "split_keywords": [
        "parsing",
        "lowlevel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78b4d6f1f3e3a43964f7a9c02a70f8cf84b2bd5317238b8faade83a98d4764e6",
                "md5": "ed47d20de48dbd94f31a344d8c824022",
                "sha256": "8a99ce553bbb5039ff6c872427c28ceb4898983585519ad7b0167f1cffaff366"
            },
            "downloads": -1,
            "filename": "dateiendifferenz-0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed47d20de48dbd94f31a344d8c824022",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 533086,
            "upload_time": "2024-01-01T23:29:12",
            "upload_time_iso_8601": "2024-01-01T23:29:12.091142Z",
            "url": "https://files.pythonhosted.org/packages/78/b4/d6f1f3e3a43964f7a9c02a70f8cf84b2bd5317238b8faade83a98d4764e6/dateiendifferenz-0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aedb7919953ae5f6d545890bfdfdeab7614fe4a5661beb566b91302e72703001",
                "md5": "751e5122e7a63f31b5b0c3147632642a",
                "sha256": "02bc843e9ccbdf85a03eee481a74480a572157e4edb39ae15f35c1467963a4a7"
            },
            "downloads": -1,
            "filename": "dateiendifferenz-0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "751e5122e7a63f31b5b0c3147632642a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 530363,
            "upload_time": "2024-01-01T23:29:14",
            "upload_time_iso_8601": "2024-01-01T23:29:14.553108Z",
            "url": "https://files.pythonhosted.org/packages/ae/db/7919953ae5f6d545890bfdfdeab7614fe4a5661beb566b91302e72703001/dateiendifferenz-0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 23:29:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "dateiendifferenz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "dateiendifferenz"
}
        
Elapsed time: 0.18985s