textfile


Nametextfile JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://jimaru.site/textfile/
SummaryFunctions that enables us to write out or read from with text file in shorter syntax.
upload_time2023-04-12 03:31:33
maintainerkenjimaru
docs_urlNone
authorkenjimaru
requires_python>=3.7,<4.0
licenseMIT
keywords text file oneline write read
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
Wrapper functions of codes of text file operation that are very commonly seen.
By using ``textfile``, readability of our program will be improve!

Install
-------

.. code-block:: Shell

    > pip install textfile


Very basic usage
----------------

Create file and write text to it.

.. code-block:: python

    >>> import textfile
    >>> textfile.write("a.txt", "any string value")

Read text from text file.

.. code-block:: python

    >>> import textfile
    >>> textfile.read("a.txt")
    "any string value"

Use cases
---------

Write string to text file:

.. code-block:: python

    textfile.write("somefile.txt", "any string value")

Read entire string from text file:

.. code-block::

    textfile.read("somefile.txt")

Replace string in text file:

.. code-block::

    textfile.replace("somefile.txt", "replaced", "replacement")

Append string to text file:

.. code-block::

    textfile.append("somefile.txt", "text to append")

Insert string to text file:

.. code-block::

    textfile.insert("somefile.txt", "text to insert", line=10)


Just a implementation of facade pattern
---------------------------------------

``textfile`` wraps python algorithms that are very commonly used
in the purpose of to more simplify basic operations.

This is just a facade pattern.

The side effect of simplify the interface of text file operation, gets less flexibility.
Further more, it becomes hard to do speed tuning.

But I think that those are not a matter in almost all situations of our programming.

We should pay more attention to code readability!

I courage you to use ``textfile`` as much as possible you can.
If you do so, the readability of your code will increase, and will suppress many bugs.


Is this document written in strange English?
--------------------------------------------
Kenjimaru, the author of this document, I am Japanese and am not familiar to English.

If you read this document, and find anything should be fixed, feel free to contact me,
and I will appreciate.


            

Raw data

            {
    "_id": null,
    "home_page": "https://jimaru.site/textfile/",
    "name": "textfile",
    "maintainer": "kenjimaru",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "kendimaru2@gmail.com",
    "keywords": "text,file,oneline,write,read",
    "author": "kenjimaru",
    "author_email": "kendimaru2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/96/5aa5ba5647a018cd44965f601101c3e0771122f3b2f07185411b64e41149/textfile-0.1.5.tar.gz",
    "platform": null,
    "description": "\nWrapper functions of codes of text file operation that are very commonly seen.\nBy using ``textfile``, readability of our program will be improve!\n\nInstall\n-------\n\n.. code-block:: Shell\n\n    > pip install textfile\n\n\nVery basic usage\n----------------\n\nCreate file and write text to it.\n\n.. code-block:: python\n\n    >>> import textfile\n    >>> textfile.write(\"a.txt\", \"any string value\")\n\nRead text from text file.\n\n.. code-block:: python\n\n    >>> import textfile\n    >>> textfile.read(\"a.txt\")\n    \"any string value\"\n\nUse cases\n---------\n\nWrite string to text file:\n\n.. code-block:: python\n\n    textfile.write(\"somefile.txt\", \"any string value\")\n\nRead entire string from text file:\n\n.. code-block::\n\n    textfile.read(\"somefile.txt\")\n\nReplace string in text file:\n\n.. code-block::\n\n    textfile.replace(\"somefile.txt\", \"replaced\", \"replacement\")\n\nAppend string to text file:\n\n.. code-block::\n\n    textfile.append(\"somefile.txt\", \"text to append\")\n\nInsert string to text file:\n\n.. code-block::\n\n    textfile.insert(\"somefile.txt\", \"text to insert\", line=10)\n\n\nJust a implementation of facade pattern\n---------------------------------------\n\n``textfile`` wraps python algorithms that are very commonly used\nin the purpose of to more simplify basic operations.\n\nThis is just a facade pattern.\n\nThe side effect of simplify the interface of text file operation, gets less flexibility.\nFurther more, it becomes hard to do speed tuning.\n\nBut I think that those are not a matter in almost all situations of our programming.\n\nWe should pay more attention to code readability!\n\nI courage you to use ``textfile`` as much as possible you can.\nIf you do so, the readability of your code will increase, and will suppress many bugs.\n\n\nIs this document written in strange English?\n--------------------------------------------\nKenjimaru, the author of this document, I am Japanese and am not familiar to English.\n\nIf you read this document, and find anything should be fixed, feel free to contact me,\nand I will appreciate.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Functions that enables us to write out or read from with text file in shorter syntax.",
    "version": "0.1.5",
    "split_keywords": [
        "text",
        "file",
        "oneline",
        "write",
        "read"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8efc2b79f1c48ebc4015b495fa07ea73fa246f49c90823b35a45e6fd67aabf65",
                "md5": "070906660c67f998de3ad5aba336aca0",
                "sha256": "b1d111a924cc6e643a75fd317de4ded430e2a095a9ffded7c5def0d78cf48855"
            },
            "downloads": -1,
            "filename": "textfile-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "070906660c67f998de3ad5aba336aca0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 3730,
            "upload_time": "2023-04-12T03:31:31",
            "upload_time_iso_8601": "2023-04-12T03:31:31.134070Z",
            "url": "https://files.pythonhosted.org/packages/8e/fc/2b79f1c48ebc4015b495fa07ea73fa246f49c90823b35a45e6fd67aabf65/textfile-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b965aa5ba5647a018cd44965f601101c3e0771122f3b2f07185411b64e41149",
                "md5": "31e35dca19db90295251f30a82505b21",
                "sha256": "057e70442275426ed76c229a14fc99e62021bb89c030748f59d29edad6475489"
            },
            "downloads": -1,
            "filename": "textfile-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "31e35dca19db90295251f30a82505b21",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 3421,
            "upload_time": "2023-04-12T03:31:33",
            "upload_time_iso_8601": "2023-04-12T03:31:33.053350Z",
            "url": "https://files.pythonhosted.org/packages/0b/96/5aa5ba5647a018cd44965f601101c3e0771122f3b2f07185411b64e41149/textfile-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-12 03:31:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "textfile"
}
        
Elapsed time: 0.07072s