molimg


Namemolimg JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/jdkern11/molimg.git
Summary
upload_time2023-06-06 17:36:45
maintainer
docs_urlNone
authorjdkern11
requires_python>=3.10,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Molecular Imager
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Tests](https://github.com/jdkern11/molimg/workflows/tests/badge.svg)](https://github.com/jdkern11/molimg/actions?workflow=tests)
[![codecov](https://codecov.io/gh/jdkern11/molimg/branch/main/graph/badge.svg?token=4MU1H8MD94)](https://codecov.io/gh/jdkern11/molimg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![version](https://img.shields.io/badge/Release-0.2.0-blue)](https://github.com/jdkern11/molimg/releases)

Do you ever wish you could easily embed the images of your smiles strings into 
an excel sheet? Wish no more! molimg is here to do just that!

Take the following data in a csv:

![image of example data](https://raw.githubusercontent.com/jdkern11/molimg/main/images/example_csv.png)

and molimg will convert it like so:

![image of example data](https://raw.githubusercontent.com/jdkern11/molimg/main/images/example_csv_with_images.png)

## Usage
First, import the data into a pandas dataframe, then pass this dataframe, the 
columns that you want to convert to images, and the save name of the file to the 
package:

```Python
import pandas as pd
from molimg import excel

df = pd.read_csv('example_data.csv')
smiles_columns = ['smiles1', 'smiles2']
excel.write(
    df=df, 
    smiles_columns=smiles_columns, 
    filename='example_data_with_images.xlsx'
)
```

The order the columns appear in df.columns is how the columns will be saved in
the new excel sheet. The new smiles columns with images will always appear to the right
of the data they originate from with `{original_column}_image` as the new column name.

Any error that occurs when trying to convert a smiles string to an image 
will appear as a warning log message and the image will not be produced. The excel sheet
will still be created with the smiles strings that work.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jdkern11/molimg.git",
    "name": "molimg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "jdkern11",
    "author_email": "josephdanielkern@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ee/b7/b0e4dd4ec8dd1960eb486dede95edb5445b499ba93c317ed177bb09e64c4/molimg-0.2.0.tar.gz",
    "platform": null,
    "description": "# Molecular Imager\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Tests](https://github.com/jdkern11/molimg/workflows/tests/badge.svg)](https://github.com/jdkern11/molimg/actions?workflow=tests)\n[![codecov](https://codecov.io/gh/jdkern11/molimg/branch/main/graph/badge.svg?token=4MU1H8MD94)](https://codecov.io/gh/jdkern11/molimg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n[![version](https://img.shields.io/badge/Release-0.2.0-blue)](https://github.com/jdkern11/molimg/releases)\n\nDo you ever wish you could easily embed the images of your smiles strings into \nan excel sheet? Wish no more! molimg is here to do just that!\n\nTake the following data in a csv:\n\n![image of example data](https://raw.githubusercontent.com/jdkern11/molimg/main/images/example_csv.png)\n\nand molimg will convert it like so:\n\n![image of example data](https://raw.githubusercontent.com/jdkern11/molimg/main/images/example_csv_with_images.png)\n\n## Usage\nFirst, import the data into a pandas dataframe, then pass this dataframe, the \ncolumns that you want to convert to images, and the save name of the file to the \npackage:\n\n```Python\nimport pandas as pd\nfrom molimg import excel\n\ndf = pd.read_csv('example_data.csv')\nsmiles_columns = ['smiles1', 'smiles2']\nexcel.write(\n    df=df, \n    smiles_columns=smiles_columns, \n    filename='example_data_with_images.xlsx'\n)\n```\n\nThe order the columns appear in df.columns is how the columns will be saved in\nthe new excel sheet. The new smiles columns with images will always appear to the right\nof the data they originate from with `{original_column}_image` as the new column name.\n\nAny error that occurs when trying to convert a smiles string to an image \nwill appear as a warning log message and the image will not be produced. The excel sheet\nwill still be created with the smiles strings that work.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/jdkern11/molimg.git",
        "Repository": "https://github.com/jdkern11/molimg.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "00baeee930cceeb5b6457d996c0736acb2823d6fc8709500ddbe3b4bbeb3d719",
                "md5": "443344d24ab29b050914c9c0427751af",
                "sha256": "552487764c826a93252347b70f6f8916ff61fe83d2786f4b5a4ecf2f2b17c209"
            },
            "downloads": -1,
            "filename": "molimg-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "443344d24ab29b050914c9c0427751af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 5231,
            "upload_time": "2023-06-06T17:36:43",
            "upload_time_iso_8601": "2023-06-06T17:36:43.743320Z",
            "url": "https://files.pythonhosted.org/packages/00/ba/eee930cceeb5b6457d996c0736acb2823d6fc8709500ddbe3b4bbeb3d719/molimg-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eeb7b0e4dd4ec8dd1960eb486dede95edb5445b499ba93c317ed177bb09e64c4",
                "md5": "0e210bd6731e84f2c3de1451f16ce2b4",
                "sha256": "d4946f1ed87d349554fcdcad63df6b73a6a6700594e26b95f08a35d8872e9a99"
            },
            "downloads": -1,
            "filename": "molimg-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0e210bd6731e84f2c3de1451f16ce2b4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 4217,
            "upload_time": "2023-06-06T17:36:45",
            "upload_time_iso_8601": "2023-06-06T17:36:45.280979Z",
            "url": "https://files.pythonhosted.org/packages/ee/b7/b0e4dd4ec8dd1960eb486dede95edb5445b499ba93c317ed177bb09e64c4/molimg-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-06 17:36:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jdkern11",
    "github_project": "molimg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "molimg"
}
        
Elapsed time: 0.07666s