{"id":34055034,"url":"https://github.com/retospect/cmdrnafold","last_synced_at":"2026-04-02T03:20:04.937Z","repository":{"id":194541524,"uuid":"691289975","full_name":"retospect/cmdrnafold","owner":"retospect","description":"Primitive wrapper around the Vienna RNAFold commandline tool.","archived":false,"fork":false,"pushed_at":"2025-10-28T19:29:55.000Z","size":66,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-05T16:59:59.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retospect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-13T22:05:46.000Z","updated_at":"2025-10-28T20:25:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"6bb22735-c548-40a1-b3db-28c8fef48f1b","html_url":"https://github.com/retospect/cmdrnafold","commit_stats":null,"previous_names":["retospect/cmdrnafold"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/retospect/cmdrnafold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fcmdrnafold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fcmdrnafold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fcmdrnafold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fcmdrnafold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retospect","download_url":"https://codeload.github.com/retospect/cmdrnafold/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fcmdrnafold/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31295062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-14T02:37:41.687Z","updated_at":"2026-04-02T03:20:04.901Z","avatar_url":"https://github.com/retospect.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmdrnafold - Professional Python Wrapper for ViennaRNA\n\n[![PyPI version](https://badge.fury.io/py/cmdrnafold.svg)](https://badge.fury.io/py/cmdrnafold)\n[![Python versions](https://img.shields.io/pypi/pyversions/cmdrnafold.svg)](https://pypi.org/project/cmdrnafold/)\n[![CI](https://github.com/retospect/cmdrnafold/actions/workflows/check.yml/badge.svg)](https://github.com/retospect/cmdrnafold/actions/workflows/check.yml)\n[![CodeQL](https://github.com/retospect/cmdrnafold/actions/workflows/codeql.yml/badge.svg)](https://github.com/retospect/cmdrnafold/actions/workflows/codeql.yml)\n[![codecov](https://codecov.io/gh/retospect/cmdrnafold/branch/main/graph/badge.svg)](https://codecov.io/gh/retospect/cmdrnafold)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Type checked: mypy](https://img.shields.io/badge/type%20checked-mypy-blue.svg)](https://mypy-lang.org/)\n[![Security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n\nA **production-ready**, **type-safe** Python wrapper for [ViennaRNA](https://www.tbi.univie.ac.at/RNA/ViennaRNA/refman/man/RNAfold.html) commandline tools with both **synchronous** and **asynchronous** interfaces.\n\nPerfect for when you need a reliable RNA folding solution but can't get the [official ViennaRNA Python bindings](https://pypi.org/project/ViennaRNA/) to work properly.\n\n## ✨ Features\n\n- 🚀 **Both sync and async interfaces** - Choose what fits your workflow\n- 🔒 **Type-safe** - Full type annotations with mypy support\n- 🛡️ **Production-ready** - Comprehensive error handling and input validation\n- 🧪 **Well-tested** - 90%+ test coverage with unit, integration, and security tests\n- 📦 **Modern Python** - Supports Python 3.10+ with modern async/await patterns\n- 🔍 **Security-focused** - Input validation prevents command injection attacks\n- 📚 **Fully documented** - Comprehensive docstrings and examples\n- 🏗️ **Professional CI/CD** - Automated testing, security scanning, and releases\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\npip install cmdrnafold\n```\n\n**Requirements:**\n- Python 3.10+\n- [ViennaRNA commandline tools](https://www.tbi.univie.ac.at/RNA/) installed and available in PATH\n\n### Basic Usage (Synchronous)\n\n```python\nfrom cmdrnafold import RNA\n\n# Simple drop-in replacement for ViennaRNA Python bindings\nsequence = \"CGCAGGGAUACCCGCG\"\n\n# Create fold compound\nfc = RNA.fold_compound(sequence)\n\n# Compute minimum free energy structure\nstructure, mfe = fc.mfe()\n\nprint(f\"{structure} [{mfe:6.2f}]\")\n# Output: ((((.......)))) [ -4.20]\n```\n\n### Advanced Usage (Asynchronous)\n\n```python\nimport asyncio\nfrom cmdrnafold import fold_compound\n\nasync def fold_rna_sequences():\n    sequences = [\n        \"CGCAGGGAUACCCGCG\",\n        \"AAAUUUGGGCCCUUUU\", \n        \"GGGCCCAAAUUUGGGCCC\"\n    ]\n    \n    # Process multiple sequences concurrently\n    tasks = []\n    for seq in sequences:\n        fc = fold_compound(seq)\n        tasks.append(fc.mfe())\n    \n    results = await asyncio.gather(*tasks)\n    \n    for seq, (structure, mfe) in zip(sequences, results):\n        print(f\"{seq}\")\n        print(f\"{structure} [{mfe:6.2f}]\")\n        print()\n\n# Run the async function\nasyncio.run(fold_rna_sequences())\n```\n\n### Error Handling\n\n```python\nfrom cmdrnafold import RNA, RNAFoldError\n\ntry:\n    # This will raise an error due to invalid nucleotides\n    fc = RNA.fold_compound(\"INVALID_SEQUENCE\")\n    structure, mfe = fc.mfe()\nexcept RNAFoldError as e:\n    print(f\"RNA folding failed: {e}\")\n```\n\n## 📖 API Reference\n\n### Classes\n\n#### `RNA.fold_compound(sequence: str) -\u003e SyncRNArunner`\nCreates a synchronous RNA fold compound (backward compatible interface).\n\n#### `fold_compound(sequence: str) -\u003e RNArunner` \nCreates an asynchronous RNA fold compound.\n\n#### `fold_compound_sync(sequence: str) -\u003e SyncRNArunner`\nCreates a synchronous RNA fold compound (explicit interface).\n\n### Methods\n\n#### `mfe() -\u003e Tuple[str, float]`\nComputes the minimum free energy (MFE) structure.\n\n**Returns:**\n- `structure`: Secondary structure in dot-bracket notation\n- `mfe`: Minimum free energy in kcal/mol\n\n**Raises:**\n- `RNAFoldError`: If folding computation fails\n\n### Input Validation\n\nThe library performs strict input validation:\n- Only valid RNA nucleotides (A, U, G, C) are allowed\n- Empty sequences are rejected\n- Command injection attempts are blocked\n- Unicode and special characters are filtered\n\n## 🧪 Development\n\n### Setup Development Environment\n\n```bash\n# Clone the repository\ngit clone https://github.com/retospect/cmdrnafold.git\ncd cmdrnafold\n\n# Install Poetry (if not already installed)\ncurl -sSL https://install.python-poetry.org | python3 -\n\n# Install dependencies\npoetry install --with dev\n\n# Install pre-commit hooks\npoetry run pre-commit install\n```\n\n### Running Tests\n\n```bash\n# Run all tests\npoetry run pytest\n\n# Run with coverage\npoetry run pytest --cov=cmdrnafold --cov-report=html\n\n# Run only unit tests\npoetry run pytest -m \"not integration\"\n\n# Run only integration tests (requires ViennaRNA)\npoetry run pytest -m \"integration\"\n\n# Run linting tests\npoetry run pytest tests/test_linting.py\n```\n\n### Code Quality\n\n```bash\n# Format code\npoetry run black src/ tests/\npoetry run isort src/ tests/\n\n# Type checking\npoetry run mypy src/\n\n# Linting\npoetry run flake8 src/ tests/\n\n# Security scan\npoetry run bandit -r src/\n```\n\n## 🔒 Security\n\nThis project takes security seriously:\n\n- **Input validation** prevents command injection attacks\n- **Bandit** static security analysis in CI\n- **CodeQL** security scanning\n- **Dependabot** for dependency vulnerability management\n- **No hardcoded secrets** or credentials\n\n## 🤝 Contributing\n\nContributions are welcome! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests (`poetry run pytest`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the GNU General Public License v3.0 or later - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [ViennaRNA Package](https://www.tbi.univie.ac.at/RNA/) - The underlying RNA folding algorithms\n- [Poetry](https://python-poetry.org/) - Dependency management and packaging\n- [pytest](https://pytest.org/) - Testing framework\n\n## 📚 Citation\n\nIf you use cmdrnafold in your research, please cite:\n\n```bibtex\n@software{cmdrnafold,\n  author = {Stamm, Reto},\n  title = {cmdrnafold: Professional Python Wrapper for ViennaRNA},\n  url = {https://github.com/retospect/cmdrnafold},\n  version = {0.0.6},\n  year = {2024}\n}\n```\n\n---\n\n**Made with ❤️ for the bioinformatics community**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretospect%2Fcmdrnafold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretospect%2Fcmdrnafold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretospect%2Fcmdrnafold/lists"}