bios


Namebios JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/bilgehannal/bios
Summarybios is a library which helps you to read and write data to determined type of files.
upload_time2019-06-23 16:59:13
maintainer
docs_urlNone
authorBilgehan NAL
requires_python
licenseMIT
keywords io read write file
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # bios

  - 'bios' is a python library which helps you for operations of I/O.
  - You can read determined type of files and assign the content of the files to the best suitable data type for these contents.
  - If it is required, developer should handle the exception handling issues.

### Install and Import

> pip install bios

    import bios

### Supported Files
 - JSON Files
	 - Can be assigned to data types of string, list or dict.
 - YAML Files
	 - Can be assigned to data types of string, list or dict.
 - CSV Files
	 - Can be assigned to data types of string or list.
 - Other Files
	- Can be assigned to data type of string.

### Operations and Using

#### Reading
You can read the file using read function of bios. If you will not give any file type, system can determined the file types showing in the below and assign the content of the files to suitable data_types.

    content1 = bios.read('file.txt')
    content2 = bios.read('file.json')
    content3 = bios.read('file.yaml')
    content4 = bios.read('file.csv')
    content4 = bios.read('file.csv', delimiter=';')
    content5 = bios.read('file.yml')
    content6 = bios.read('file')

	# Type of content1 and contend6 is string
	# Type of content2, content3 and content5 is dict or list
	# Tyoe of content4 is list

- ##### Standart File

You can read the content of a file and assign it into a string.

    content = bios.read('file.txt', file_type='standart')

- ##### JSON File

You can read the content of a JSON file and assign it into a dict or list object.

    content = bios.read('file.json', file_type='json')

Type of the content could be 'list' or 'dict'
- ##### YAML File

You can read the content of a YAML file and assign it into a dict or list object.

    content = bios.read('file.yaml', file_type='yaml')
    content = bios.read('file.yaml', file_type='yml')

Type of the content could be 'list' or 'dict'
- ##### CSV File

You can read the content of a CSV file and assign it into a list. Default delimiter is comma ' , '.

    content = bios.read('file.json', file_type='csv')
	content = bios.read('file.json', file_type='csv', delimiter=';')

Type of the content could be 'list'

#### Writing
You can write your 'data' object to a file. If you will not give a specific file a file type, file type is determined according to the file name.

    bios.write('file.txt', data1)
    bios.write('file.json', data2)
    bios.write('file.yaml', data3)
    bios.write('file.csv', data4)
    bios.write('file.csv', data4, delimiter=';')
    bios.write('file.yml', data5)
    bios.write('file', data5)
	
	# data1 and data5 must be a string
	# data2, data3 and data5 must be a dict or list object
	# data4 must be a list object
	
- ##### Standart File

You can write a string object to any file giving a file type as 'standart'

     bios.write('file.txt', data, file_type='standart')

- ##### JSON File

You can write a list or dict object to any file giving a file type as 'json'

     bios.write('file.json', data, file_type='json')
     
- ##### YAML File

You can write a list or dict object to any file giving a file type as 'yaml' or 'yml'

     bios.write('file.yml', data, file_type='yaml')
     
- ##### CSV File

You can write a list object to any file giving a file type as 'standart'

     bios.write('file.csv', data, file_type='csv')
     bios.write('file.csv', data, file_type='csv', delimiter=';')

You can use the parameter of 'delimiter' for separating the contents from each other.
     
#### Appending
You can append or add a content to an existing file. This function is available for only text files or csv files.

    bios.append('file.txt', data)
    bios.append('file.txt', data, line=2)
    bios.append('file.txt', data, delimiter=';')
    bios.append('file.csv', data, line=2, delimiter=';')
    
Line is assumed that starting from the value of 1

- ##### Standart File

You can append a string object to a existing or nonexistent file. If you don't give a line parameter, bios would append the content after the end of the file.

     bios.append('file.txt', data, file_type='standart')
     bios.append('file.txt', data, file_type='standart', line=2)

- ##### CSV File

You can append a list object to a existing or nonexistent file. If you don't give a line parameter, bios would append the content after the end of the file.

     bios.append('file.csv', data, file_type='csv')
     bios.append('file.csv', data, file_type='csv', line=2)

###  Example

    import bios
    content = bios.read('files/my_file.csv')
    second_row = content[1]
    for single_column in second_row:
	    print(single_column)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bilgehannal/bios",
    "name": "bios",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "io,read,write,file",
    "author": "Bilgehan NAL",
    "author_email": "bilgehannal@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b9/a0/368aac80c0ce24e014854621550bb802b82eb4e9c33d945866117ddc944e/bios-0.1.2.tar.gz",
    "platform": "",
    "description": "# bios\n\n  - 'bios' is a python library which helps you for operations of I/O.\n  - You can read determined type of files and assign the content of the files to the best suitable data type for these contents.\n  - If it is required, developer should handle the exception handling issues.\n\n### Install and Import\n\n> pip install bios\n\n    import bios\n\n### Supported Files\n - JSON Files\n\t - Can be assigned to data types of string, list or dict.\n - YAML Files\n\t - Can be assigned to data types of string, list or dict.\n - CSV Files\n\t - Can be assigned to data types of string or list.\n - Other Files\n\t- Can be assigned to data type of string.\n\n### Operations and Using\n\n#### Reading\nYou can read the file using read function of bios. If you will not give any file type, system can determined the file types showing in the below and assign the content of the files to suitable data_types.\n\n    content1 = bios.read('file.txt')\n    content2 = bios.read('file.json')\n    content3 = bios.read('file.yaml')\n    content4 = bios.read('file.csv')\n    content4 = bios.read('file.csv', delimiter=';')\n    content5 = bios.read('file.yml')\n    content6 = bios.read('file')\n\n\t# Type of content1 and contend6 is string\n\t# Type of content2, content3 and content5 is dict or list\n\t# Tyoe of content4 is list\n\n- ##### Standart File\n\nYou can read the content of a file and assign it into a string.\n\n    content = bios.read('file.txt', file_type='standart')\n\n- ##### JSON File\n\nYou can read the content of a JSON file and assign it into a dict or list object.\n\n    content = bios.read('file.json', file_type='json')\n\nType of the content could be 'list' or 'dict'\n- ##### YAML File\n\nYou can read the content of a YAML file and assign it into a dict or list object.\n\n    content = bios.read('file.yaml', file_type='yaml')\n    content = bios.read('file.yaml', file_type='yml')\n\nType of the content could be 'list' or 'dict'\n- ##### CSV File\n\nYou can read the content of a CSV file and assign it into a list. Default delimiter is comma ' , '.\n\n    content = bios.read('file.json', file_type='csv')\n\tcontent = bios.read('file.json', file_type='csv', delimiter=';')\n\nType of the content could be 'list'\n\n#### Writing\nYou can write your 'data' object to a file. If you will not give a specific file a file type, file type is determined according to the file name.\n\n    bios.write('file.txt', data1)\n    bios.write('file.json', data2)\n    bios.write('file.yaml', data3)\n    bios.write('file.csv', data4)\n    bios.write('file.csv', data4, delimiter=';')\n    bios.write('file.yml', data5)\n    bios.write('file', data5)\n\t\n\t# data1 and data5 must be a string\n\t# data2, data3 and data5 must be a dict or list object\n\t# data4 must be a list object\n\t\n- ##### Standart File\n\nYou can write a string object to any file giving a file type as 'standart'\n\n     bios.write('file.txt', data, file_type='standart')\n\n- ##### JSON File\n\nYou can write a list or dict object to any file giving a file type as 'json'\n\n     bios.write('file.json', data, file_type='json')\n     \n- ##### YAML File\n\nYou can write a list or dict object to any file giving a file type as 'yaml' or 'yml'\n\n     bios.write('file.yml', data, file_type='yaml')\n     \n- ##### CSV File\n\nYou can write a list object to any file giving a file type as 'standart'\n\n     bios.write('file.csv', data, file_type='csv')\n     bios.write('file.csv', data, file_type='csv', delimiter=';')\n\nYou can use the parameter of 'delimiter' for separating the contents from each other.\n     \n#### Appending\nYou can append or add a content to an existing file. This function is available for only text files or csv files.\n\n    bios.append('file.txt', data)\n    bios.append('file.txt', data, line=2)\n    bios.append('file.txt', data, delimiter=';')\n    bios.append('file.csv', data, line=2, delimiter=';')\n    \nLine is assumed that starting from the value of 1\n\n- ##### Standart File\n\nYou can append a string object to a existing or nonexistent file. If you don't give a line parameter, bios would append the content after the end of the file.\n\n     bios.append('file.txt', data, file_type='standart')\n     bios.append('file.txt', data, file_type='standart', line=2)\n\n- ##### CSV File\n\nYou can append a list object to a existing or nonexistent file. If you don't give a line parameter, bios would append the content after the end of the file.\n\n     bios.append('file.csv', data, file_type='csv')\n     bios.append('file.csv', data, file_type='csv', line=2)\n\n###  Example\n\n    import bios\n    content = bios.read('files/my_file.csv')\n    second_row = content[1]\n    for single_column in second_row:\n\t    print(single_column)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "bios is a library which helps you to read and write data to determined type of files.",
    "version": "0.1.2",
    "project_urls": {
        "Download": "https://github.com/bilgehannal/bios/archive/v_01.tar.gz",
        "Homepage": "https://github.com/bilgehannal/bios"
    },
    "split_keywords": [
        "io",
        "read",
        "write",
        "file"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9a0368aac80c0ce24e014854621550bb802b82eb4e9c33d945866117ddc944e",
                "md5": "f2668fd4f99ad590fc1a2c4a080ab1ed",
                "sha256": "bccfc24011b6a631a6edeef1069551a4ecaaff7b3ed50a6221a68075850500e9"
            },
            "downloads": -1,
            "filename": "bios-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "f2668fd4f99ad590fc1a2c4a080ab1ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4709,
            "upload_time": "2019-06-23T16:59:13",
            "upload_time_iso_8601": "2019-06-23T16:59:13.670203Z",
            "url": "https://files.pythonhosted.org/packages/b9/a0/368aac80c0ce24e014854621550bb802b82eb4e9c33d945866117ddc944e/bios-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-06-23 16:59:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bilgehannal",
    "github_project": "bios",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bios"
}
        
Elapsed time: 0.13841s