{"id":23784,"library":"gemfileparser2","title":"gemfileparser2","description":"Parse Ruby Gemfile, .gemspec and Cocoapod .podspec files using Python. Current version 0.9.4, requires Python >=3.7. Maintenance cadence is sporadic.","status":"active","version":"0.9.4","language":"python","source_language":"en","source_url":"https://github.com/aboutcode-org/gemfileparser2","tags":["ruby","gemfile","parser","cocoapods"],"install":[{"cmd":"pip install gemfileparser2","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for parsing .gemspec files","package":"pyyaml","optional":true}],"imports":[{"note":"Prior to v0.9.0 the package was named gemfileparser, renamed to avoid conflict.","wrong":"from gemfileparser import GemfileParser","symbol":"GemfileParser","correct":"from gemfileparser2 import GemfileParser"}],"quickstart":{"code":"from gemfileparser2 import GemfileParser\nimport os\n\n# Parse a Gemfile\nwith open('Gemfile', 'r') as f:\n    content = f.read()\nparser = GemfileParser().parse(content)\nprint(parser.dependencies)","lang":"python","description":"Read and parse a Ruby Gemfile."},"warnings":[{"fix":"Change 'from gemfileparser import ...' to 'from gemfileparser2 import ...'","message":"The package was renamed from gemfileparser to gemfileparser2 in v0.9.0. All imports must be updated.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"Read the file content with open() and pass the string to parse().","message":"The parse() method accepts plain text string, not a file path. Passing a file path will fail silently or raise an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'gemfileparser2' instead of 'gemfileparser'.","message":"The old module 'gemfileparser' was restored in v0.9.3 for compatibility but may be removed in future releases.","severity":"deprecated","affected_versions":"0.9.3+"}],"env_vars":null,"search_vec":"'0.9.4':14 '3.7':17 'cadenc':19 'cocoapod':7,25 'current':12 'file':9 'gemfil':4,23 'gemfileparser2':1 'gemspec':5 'mainten':18 'pars':2 'parser':24 'podspec':8 'python':11,16 'requir':15 'rubi':3,22 'sporad':21 'use':10 'version':13","created_at":"2026-05-01T08:09:36.702248+00:00","updated_at":"2026-05-01T08:09:36.702248+00:00","problems":[{"fix":"Install gemfileparser2 and import from gemfileparser2.","cause":"Package renamed to gemfileparser2 in v0.9.0.","error":"ModuleNotFoundError: No module named 'gemfileparser'"},{"fix":"Open the file and read its content: open('Gemfile').read()","cause":"Passing a file path string to parse() instead of file contents.","error":"AttributeError: 'str' object has no attribute 'read'"},{"fix":"Ensure the Gemfile is valid Ruby syntax.","cause":"Malformed Gemfile content (e.g., syntax error in Ruby source).","error":"gemfileparser2.exceptions.ParseError: Expected ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.9.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/aboutcode-org/gemfileparser2","docs":null,"changelog":null,"pypi":"https://pypi.org/project/gemfileparser2/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}