{ "info": { "author": "Sarbjit Singh", "author_email": "srbcheema1@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.5" ], "description": "# srblib\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.ocm/srbcheema1/srblib/issues)\n[![a srbcheema1 production](https://img.shields.io/badge/-a%20srbcheema1%20production-blue.svg)](https://github.com/srbcheema1)\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/srbcheema1/srblib)\n[![HitCount](http://hits.dwyl.io/srbcheema1/srblib.svg)](http://hits.dwyl.io/srbcheema1/srblib)\n\n**srblib** is an umberalla python library to hold my useful python scripts which can be used in other projects.\n\n\n### Installation\n\n#### Install using pip (Recommended)\n\n- Use pip to install, user `--user` flag\n```\npython3 -m pip install --user srblib\n```\n\n#### Build from Source\n\n- Clone the repository and checkout to stable commit\n```\ngit clone https://github.com/srbcheema1/srblib\ncd srblib\ngit checkout \n```\n\n- install requirements\n```\npython3 -m pip install --user -r requirements.txt\n```\n- Install srblib\n```\npython3 setup.py install --user\n```\n- Building Source Distribution\n```\npython3 setup.py sdist\n```\n\n\n### Classes Offered\n\n\n- Colour - A class with color names and a static print function which prints coloured output to stderr\n```\n Colour.print(message,Colour.RED) # for foreground as red\n Colour.print(message,Colour.FULLGREEN) # for background as green\n Colour.print(message,Colour.FULLGREEN+Colour.RED) # for background as fullgreen and foreground as RED\n```\n- SrbBank - A class to store things for later use of a program. can act as a database\n```\n a = SrbBank('db_name') #say the db_name is your database name\n a['hello'] = \"world\"\n b = SrbBank('db2','password')\n b['hello'] = \"peeps\"\n # EXIT THE CODE AND START NEW SESSION\n a = SrbBank('db_name')\n print(a['hello']) # 'world'\n b = SrbBank('db2','password')\n print(b['hello']) # 'peeps'\n```\n- SrbJson - A class to use json file more easily\n```\n a = SrbJson('json/path')\n a['hello'] = 'world'\n # EXIT THE CODE AND START NEW SESSION\n a = SrbJson('json/path')\n print(a['hello']) # 'world'\n```\n- Tabular - A class to user tabular data and read write json,xlsx,csv files\n```\n a = Tabular('path/to/file') # can take files with extension as csv,json,xlsx\n print(a) # prints table in tabular form\n data = a.matrix # get data in form of list of lists i.e. matrix\n json_data = a.json # get data in form of list of dictionaries i.e. json\n print(a[1]['name']) # here name is the attribute used to name the columns\n print(a[0]) # prints attributes\n print(a[1]) # prints 1st row (0 based)\n print(a['name']) # prints column with attribute 'name'\n a.write_xls('output/path')\n a.write_csv('output/path')\n a.write_json('output/path')\n```\n\n### Functions Offered\n\n- abs_path - returns absolute path of a path given. works on windows as well as linux.\n- get_os_name - returns OS name. values are windows, linux or mac\n- is_installed - checks if the following application is installed on machine or not\n- file_extension - returns back the extention of a file from filepath, may return '' if no ext\n- file_name - returns filename from a filepath\n- remove - removes a path recursively. it deletes all files and folders under that path\n- verify_file - verify that a file exists. if not it will create one. also creates parents if needed\n- verify_folder - verify that a folder exists. creates one if not there. also creates parents if needed\n\n\n### Variables Offered\n\n- debug - a boolean whose value can be changed in ~/.config/srblib/debug.json\n\n\n### Contact / Social Media\n\n[![Github](https://raw.githubusercontent.com/srbcheema1/CheemaFy/master/myPlugins/extra_things/png_images/social/github.png)](https://github.com/srbcheema1/)\n[![LinkedIn](https://raw.githubusercontent.com/srbcheema1/CheemaFy/master/myPlugins/extra_things/png_images/social/linkedin-48x48.png)](https://www.linkedin.com/in/srbcheema1/)\n[![Facebook](https://raw.githubusercontent.com/srbcheema1/CheemaFy/master/myPlugins/extra_things/png_images/social/fb.png)](https://www.facebook.com/srbcheema/)\n\n\n### Development by\n\nDeveloper / Author: [Srb Cheema](https://github.com/srbcheema1/)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/srbcheema1/srb_lib_004", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "srb-lib-004", "package_url": "https://pypi.org/project/srb-lib-004/", "platform": "", "project_url": "https://pypi.org/project/srb-lib-004/", "project_urls": { "Homepage": "http://github.com/srbcheema1/srb_lib_004" }, "release_url": "https://pypi.org/project/srb-lib-004/0.0.1/", "requires_dist": [ "pandas", "terminaltables", "xlwt", "xlrd" ], "requires_python": "", "summary": "A python library by srb", "version": "0.0.1" }, "last_serial": 4646177, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ab5cce4b121070f0c8ed1ceaef5f0575", "sha256": "0f02ad4326efc3dcf1731865b0e10423353dbc95ab5aa2adc322d41e7581a28a" }, "downloads": -1, "filename": "srb_lib_004-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab5cce4b121070f0c8ed1ceaef5f0575", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41855, "upload_time": "2018-12-30T13:12:42", "url": "https://files.pythonhosted.org/packages/98/d5/97f805c92fa90a4598402d6fb3d924fc32b92cce3afafb6056a7e5d4dffc/srb_lib_004-0.0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab5cce4b121070f0c8ed1ceaef5f0575", "sha256": "0f02ad4326efc3dcf1731865b0e10423353dbc95ab5aa2adc322d41e7581a28a" }, "downloads": -1, "filename": "srb_lib_004-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab5cce4b121070f0c8ed1ceaef5f0575", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41855, "upload_time": "2018-12-30T13:12:42", "url": "https://files.pythonhosted.org/packages/98/d5/97f805c92fa90a4598402d6fb3d924fc32b92cce3afafb6056a7e5d4dffc/srb_lib_004-0.0.1-py3-none-any.whl" } ] }