{"id":26457806,"url":"https://github.com/jmenglund/pandas-charm","last_synced_at":"2026-04-27T18:05:13.205Z","repository":{"id":57450440,"uuid":"62513333","full_name":"jmenglund/pandas-charm","owner":"jmenglund","description":"Python library for getting character matrices (alignments) into and out of pandas","archived":false,"fork":false,"pushed_at":"2019-05-19T11:53:08.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-03T01:59:21.149Z","etag":null,"topics":["aligned-sequences","alignment","biopython","character-matrix","dendropy","pandas","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmenglund.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-03T20:08:27.000Z","updated_at":"2019-05-19T11:39:29.000Z","dependencies_parsed_at":"2022-08-25T23:01:01.098Z","dependency_job_id":null,"html_url":"https://github.com/jmenglund/pandas-charm","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jmenglund/pandas-charm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmenglund%2Fpandas-charm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmenglund%2Fpandas-charm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmenglund%2Fpandas-charm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmenglund%2Fpandas-charm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmenglund","download_url":"https://codeload.github.com/jmenglund/pandas-charm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmenglund%2Fpandas-charm/sbom","scorecard":{"id":524265,"data":{"date":"2025-08-11","repo":{"name":"github.com/jmenglund/pandas-charm","commit":"f9f03335080c2ba6e3464c6a1ec4629bcbd26a74"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2020-73"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T03:56:34.504Z","repository_id":57450440,"created_at":"2025-08-20T03:56:34.504Z","updated_at":"2025-08-20T03:56:34.504Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aligned-sequences","alignment","biopython","character-matrix","dendropy","pandas","python"],"created_at":"2025-03-18T23:07:19.357Z","updated_at":"2026-04-27T18:05:13.188Z","avatar_url":"https://github.com/jmenglund.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pandas-charm\n============\n\n|Build-Status| |Coverage-Status| |PyPI-Status| |License| |DOI-URI|\n\npandas-charm is a small Python package for getting character\nmatrices (alignments) into and out of `pandas \u003chttp://pandas.pydata.org\u003e`_.\nUse this library to make pandas interoperable with\n`BioPython \u003chttp://biopython.org\u003e`_ and `DendroPy \u003chttp://dendropy.org\u003e`_.\n\nConvert between the following objects:\n\n* BioPython MultipleSeqAlignment \u003c-\u003e pandas DataFrame\n* DendroPy CharacterMatrix \u003c-\u003e pandas DataFrame\n* \"Sequence dictionary\" \u003c-\u003e pandas DataFrame\n\nThe code has been tested with Python 2.7, 3.5 and 3.6.\n\nSource repository: `\u003chttps://github.com/jmenglund/pandas-charm\u003e`_\n\n------------------------------------------\n\n.. contents:: Table of contents\n   :backlinks: none\n   :local:\n\n\nInstallation\n------------\n\nFor most users, the easiest way is probably to install the latest version\nhosted on `PyPI \u003chttps://pypi.org/\u003e`_:\n\n.. code-block::\n\n    $ pip install pandas-charm\n\nThe project is hosted at https://github.com/jmenglund/pandas-charm and\ncan also be installed using git:\n\n.. code-block::\n\n    $ git clone https://github.com/jmenglund/pandas-charm.git\n    $ cd pandas-charm\n    $ python setup.py install\n\n\nYou may consider installing pandas-charm and its required Python packages\nwithin a virtual environment in order to avoid cluttering your system's\nPython path. See for example the environment management system\n`conda \u003chttp://conda.pydata.org\u003e`_ or the package\n`virtualenv \u003chttps://virtualenv.pypa.io/en/latest/\u003e`_.\n\n\nRunning the tests\n-----------------\n\nTesting is carried out with `pytest \u003chttps://docs.pytest.org/\u003e`_:\n\n.. code-block::\n\n    $ pytest -v test_pandascharm.py\n\nTest coverage can be calculated with `Coverage.py\n\u003chttps://coverage.readthedocs.io/\u003e`_ using the following commands:\n\n.. code-block::\n\n    $ coverage run -m pytest\n    $ coverage report -m pandascharm.py\n\nThe code follow style conventions in `PEP8\n\u003chttps://www.python.org/dev/peps/pep-0008/\u003e`_, which can be checked\nwith `pycodestyle \u003chttp://pycodestyle.pycqa.org\u003e`_:\n\n.. code-block::\n\n    $ pycodestyle pandascharm.py test_pandascharm.py setup.py\n\n\nUsage\n-----\n\nThe following examples show how to use pandas-charm. The examples are\nwritten with Python 3 code, but pandas-charm should work also with\nPython 2.7+. You need to install BioPython and/or DendroPy manually\nbefore you start:\n\n.. code-block::\n\n    $ pip install biopython\n    $ pip install dendropy\n\n\nDendroPy CharacterMatrix to pandas DataFrame\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e import pandascharm as pc\n    \u003e\u003e\u003e import dendropy\n    \u003e\u003e\u003e dna_string = '3 5\\nt1  TCCAA\\nt2  TGCAA\\nt3  TG-AA\\n'\n    \u003e\u003e\u003e print(dna_string)\n    3 5\n    t1  TCCAA\n    t2  TGCAA\n    t3  TG-AA\n\n    \u003e\u003e\u003e matrix = dendropy.DnaCharacterMatrix.get(\n    ...     data=dna_string, schema='phylip')\n    \u003e\u003e\u003e df = pc.from_charmatrix(matrix)\n    \u003e\u003e\u003e df\n      t1 t2 t3\n    0  T  T  T\n    1  C  G  G\n    2  C  C  -\n    3  A  A  A\n    4  A  A  A\n\nBy default, characters are stored as rows and sequences as columns\nin the DataFrame. If you want rows to hold sequences, just transpose\nthe matrix in pandas:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e df.transpose()\n        0  1  2  3  4\n    t1  T  C  C  A  A\n    t2  T  G  C  A  A\n    t3  T  G  -  A  A\n\n\npandas DataFrame to Dendropy CharacterMatrix\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e import pandascharm as pc\n    \u003e\u003e\u003e import dendropy\n    \u003e\u003e\u003e df = pd.DataFrame({\n    ...     't1': ['T', 'C', 'C', 'A', 'A'],\n    ...     't2': ['T', 'G', 'C', 'A', 'A'],\n    ...     't3': ['T', 'G', '-', 'A', 'A']})\n    \u003e\u003e\u003e df\n      t1 t2 t3\n    0  T  T  T\n    1  C  G  G\n    2  C  C  -\n    3  A  A  A\n    4  A  A  A\n\n    \u003e\u003e\u003e matrix = pc.to_charmatrix(df, data_type='dna')\n    \u003e\u003e\u003e print(matrix.as_string('phylip'))\n    3 5\n    t1  TCCAA\n    t2  TGCAA\n    t3  TG-AA\n\n\nBioPython MultipleSeqAlignment to pandas DataFrame\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from io import StringIO\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e import pandascharm as pc\n    \u003e\u003e\u003e from Bio import AlignIO\n    \u003e\u003e\u003e dna_string = '3 5\\nt1  TCCAA\\nt2  TGCAA\\nt3  TG-AA\\n'\n    \u003e\u003e\u003e f = StringIO(dna_string)  # make the string a file-like object\n    \u003e\u003e\u003e alignment = AlignIO.read(f, 'phylip-relaxed')\n    \u003e\u003e\u003e print(alignment)\n    SingleLetterAlphabet() alignment with 3 rows and 5 columns\n    TCCAA t1\n    TGCAA t2\n    TG-AA t3\n    \u003e\u003e\u003e df = pc.from_bioalignment(alignment)\n    \u003e\u003e\u003e df\n      t1 t2 t3\n    0  T  T  T\n    1  C  G  G\n    2  C  C  -\n    3  A  A  A\n    4  A  A  A\n\n\npandas DataFrame to BioPython MultipleSeqAlignment\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e import pandascharm as pc\n    \u003e\u003e\u003e import Bio\n    \u003e\u003e\u003e df = pd.DataFrame({\n    ...     't1': ['T', 'C', 'C', 'A', 'A'],\n    ...     't2': ['T', 'G', 'C', 'A', 'A'],\n    ...     't3': ['T', 'G', '-', 'A', 'A']})\n    \u003e\u003e\u003e df\n      t1 t2 t3\n    0  T  T  T\n    1  C  G  G\n    2  C  C  -\n    3  A  A  A\n    4  A  A  A\n\n    \u003e\u003e\u003e alignment = pc.to_bioalignment(df, alphabet='generic_dna')\n    \u003e\u003e\u003e print(alignment)\n    SingleLetterAlphabet() alignment with 3 rows and 5 columns\n    TCCAA t1\n    TGCAA t2\n    TG-AA t3\n\n\n\"Sequence dictionary\" to pandas DataFrame\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e import pandascharm as pc\n    \u003e\u003e\u003e d = {\n    ...     't1': 'TCCAA',\n    ...     't2': 'TGCAA',\n    ...     't3': 'TG-AA'\n    ... }\n    \u003e\u003e\u003e df = pc.from_sequence_dict(d)\n    \u003e\u003e\u003e df\n      t1 t2 t3\n    0  T  T  T\n    1  C  G  G\n    2  C  C  -\n    3  A  A  A\n    4  A  A  A\n\n\npandas DataFrame to \"sequence dictionary\"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e import pandascharm as pc\n    \u003e\u003e\u003e df = pd.DataFrame({\n    ...     't1': ['T', 'C', 'C', 'A', 'A'],\n    ...     't2': ['T', 'G', 'C', 'A', 'A'],\n    ...     't3': ['T', 'G', '-', 'A', 'A']})\n    \u003e\u003e\u003e pc.to_sequence_dict(df)\n    {'t1': 'TCCAA', 't2': 'TGCAA', 't3': 'TG-AA'}\n\n\nThe name\n--------\n\npandas-charm got its name from the pandas library plus an acronym for\nCHARacter Matrix.\n\n\nLicense\n-------\n\npandas-charm is distributed under the `MIT license \u003chttps://opensource.org/licenses/MIT\u003e`_.\n\n\nCiting\n------\n\nIf you use results produced with this package in a scientific\npublication, please just mention the package name in the text and\ncite the Zenodo DOI of this project:\n\n|DOI-URI|\n\nChoose your preferred citation style in the \"Cite as\" section on the Zenodo\npage.\n\n\nAuthor\n------\n\nMarkus Englund, `orcid.org/0000-0003-1688-7112 \u003chttp://orcid.org/0000-0003-1688-7112\u003e`_\n\n\n.. |Build-Status| image:: https://travis-ci.org/jmenglund/pandas-charm.svg?branch=master\n   :target: https://travis-ci.org/jmenglund/pandas-charm\n   :alt: Build status\n.. |Coverage-Status| image:: https://codecov.io/gh/jmenglund/pandas-charm/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/jmenglund/pandas-charm\n   :alt: Coverage status\n.. |PyPI-Status| image:: https://img.shields.io/pypi/v/pandas-charm.svg\n   :target: https://pypi.python.org/pypi/pandas-charm\n   :alt: PyPI status\n.. |License| image:: https://img.shields.io/pypi/l/pandas-charm.svg\n   :target: https://raw.githubusercontent.com/jmenglund/pandas-charm/master/LICENSE.txt\n   :alt: License\n.. |DOI-URI| image:: https://zenodo.org/badge/62513333.svg\n   :target: https://zenodo.org/badge/latestdoi/62513333\n   :alt: DOI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmenglund%2Fpandas-charm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmenglund%2Fpandas-charm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmenglund%2Fpandas-charm/lists"}