{"id":18453951,"url":"https://github.com/deepmatterltd/rdfreader","last_synced_at":"2025-04-08T03:35:37.202Z","repository":{"id":175271536,"uuid":"636182869","full_name":"deepmatterltd/rdfreader","owner":"deepmatterltd","description":"Read the full contents of CTAB .rdf files in python. Captures RXN and MOL record using RDKit and reads additional data fields (including solvents/catalysts/agents). ","archived":false,"fork":false,"pushed_at":"2024-08-05T16:33:21.000Z","size":349,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-10-05T21:15:57.417Z","etag":null,"topics":["cheminformatics","ctab","rdkit"],"latest_commit_sha":null,"homepage":"http://www.deepmatter.io","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/deepmatterltd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-04T09:42:58.000Z","updated_at":"2024-08-09T08:44:49.000Z","dependencies_parsed_at":"2024-02-19T17:59:37.917Z","dependency_job_id":"1187139b-d372-435e-943a-da39932beb39","html_url":"https://github.com/deepmatterltd/rdfreader","commit_stats":null,"previous_names":["deepmatterltd/rdfreader"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmatterltd%2Frdfreader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmatterltd%2Frdfreader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmatterltd%2Frdfreader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmatterltd%2Frdfreader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepmatterltd","download_url":"https://codeload.github.com/deepmatterltd/rdfreader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223271295,"owners_count":17117302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cheminformatics","ctab","rdkit"],"created_at":"2024-11-06T08:02:16.195Z","updated_at":"2024-11-06T08:02:16.862Z","avatar_url":"https://github.com/deepmatterltd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RDF READER\n\n[![Coverage Status](https://coveralls.io/repos/github/deepmatterltd/rdfreader/badge.svg)](https://coveralls.io/github/deepmatterltd/rdfreader)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/deepmatterltd/rdfreader/main.svg)](https://results.pre-commit.ci/latest/github/deepmatterltd/rdfreader/main)\n[![Tests](https://github.com/deepmatterltd/rdfreader/actions/workflows/test.yml/badge.svg)](https://github.com/deepmatterltd/rdfreader/actions?workflow=test)\n[![License](https://img.shields.io/github/license/deepmatterltd/rdfreader)](https://github.com/deepmatterltd/rdfreader/blob/master/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n[![Python versions](https://img.shields.io/pypi/pyversions/rdfreader.svg)](https://pypi.python.org/pypi/rdfreader/)\n\n## User Guide\n\n### Installation\n\n``` bash\npip install rdfreader\n```\n\n### Basic Usage\n\n``` python\nfrom rdfreader import RDFParser\n\nrdf_file_name = \"reactions.rdf\"\n\nwith open(rdf_file_name, \"r\") as rdf_file:\n\n    # create a RDFParser object, this is a generator that yields Reaction objects\n    rdfreader = RDFParser(\n        rdf_file,\n        except_on_invalid_molecule=False,  # will return None instead of raising an exception if a molecule is invalid\n        except_on_invalid_reaction=False,  # will return None instead of raising an exception if a reaction is invalid \n    )\n\n    for rxn in rdfreader:\n        if rxn is None:\n            continue # the parser failed to read the reaction, go to the next one\n  \n        # rxn is a Reaction object, it is several attributes, including:\n        print(rxn.smiles) # reaction SMILES string\n        print(rxn.properties) # a dictionary of properties extracted from the RXN record\n        \n        reactants = rxn.reactants # a list of Molecule objects\n        products = rxn.products\n        solvents = rxn.solvents \n        catalysts = rxn.catalysts \n \n        # Molecule objects have several attributes, including:\n        print(reactants[0].smiles)\n        print(reactants[0].properties) # a dictionary of properties extracted from the MOL record (often empty)\n        reactants[0].rd_mol # an RDKit molecule object\n```\n\n## Developer Guide\n\nThe project is managed and packaged using [poetry](https://python-poetry.org/docs/#installation).\n\n### Installation\n\n``` bash\ngit clone https://github.com/deepmatterltd/rdfreader\npoetry install  # create a virtual environment and install the project dependencies\npre-commit install  # install pre-commit hooks, these mostly manage codestyle\n```\n\n### Contributions\n\nContributions are welcome via the [fork and pull request model](https://docs.github.com/en/get-started/quickstart/contributing-to-projects).\n\nBefore you commit changes, ensure these pass the hooks installed by pre-commit. This should be run automatically on each commit if you have run `pre-commit install`, but can be run manually from the terminal with `pre-commit run`.\n\n### Releases\n\nReleases are managed by GitHub releases/workflow. The version number in the pyproject file should ideally be kept up to date to the current release but is ignored by the release workflow.\n\nTo release a new version:\n\n- Update the pyproject.toml version number.\n- Push the changes to GitHub and merge to main via a pull request.\n- Use the github website to create a release. Tag the commit to be released with a version number, e.g. v1.2.3. The tag should be in v*.*.* and match the version number in the pyproject.toml file.\n- When the release is published, a github workflow will run, build a wheel and publish it to PyPI.\n\n### Example Data\n\nYou can find example data in the `test/resources directory`. `spresi-100.rdf` contains 100 example records from SPRESI.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepmatterltd%2Frdfreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepmatterltd%2Frdfreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepmatterltd%2Frdfreader/lists"}