{"id":25830737,"url":"https://github.com/ravencentric/atomicwriter","last_synced_at":"2025-10-07T04:10:33.125Z","repository":{"id":277355281,"uuid":"932161988","full_name":"Ravencentric/atomicwriter","owner":"Ravencentric","description":"Cross-platform atomic file writer for all-or-nothing operations.","archived":false,"fork":false,"pushed_at":"2025-10-06T18:26:57.000Z","size":261,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T20:35:11.297Z","etag":null,"topics":["atomic","file","python","writer"],"latest_commit_sha":null,"homepage":"https://ravencentric.cc/atomicwriter/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ravencentric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2025-02-13T13:24:00.000Z","updated_at":"2025-10-06T18:26:57.000Z","dependencies_parsed_at":"2025-07-18T14:52:34.858Z","dependency_job_id":"1f3432b9-5c0b-46b7-b9bf-4c8b1f97c199","html_url":"https://github.com/Ravencentric/atomicwriter","commit_stats":null,"previous_names":["ravencentric/atomicfile","ravencentric/atomicwriter"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Ravencentric/atomicwriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ravencentric","download_url":"https://codeload.github.com/Ravencentric/atomicwriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicwriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717483,"owners_count":26033547,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"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":["atomic","file","python","writer"],"created_at":"2025-02-28T19:30:56.411Z","updated_at":"2025-10-07T04:10:33.093Z","avatar_url":"https://github.com/Ravencentric.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# atomicwriter\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/Ravencentric/atomicwriter/tests.yml?label=tests)](https://github.com/Ravencentric/atomicwriter/actions/workflows/tests.yml)\n[![Build](https://img.shields.io/github/actions/workflow/status/Ravencentric/atomicwriter/release.yml?label=build)](https://github.com/Ravencentric/atomicwriter/actions/workflows/release.yml)\n![PyPI - Types](https://img.shields.io/pypi/types/atomicwriter)\n![License](https://img.shields.io/pypi/l/atomicwriter?color=success)\n\n[![PyPI - Latest Version](https://img.shields.io/pypi/v/atomicwriter?color=blue)](https://pypi.org/project/atomicwriter)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/atomicwriter)\n![PyPI - Implementation](https://img.shields.io/pypi/implementation/atomicwriter)\n\n`atomicwriter` provides the `AtomicWriter` class, which performs cross-platform atomic file writes to ensure \"all-or-nothing\" operations—if a write fails, the target file is left unchanged.\n\n## Table Of Contents\n\n- [Usage](#usage)\n- [Installation](#installation)\n- [Building from source](#building-from-source)\n- [Acknowledgements](#acknowledgements)\n- [License](#license)\n- [Contributing](#contributing)\n\n## Usage\n\n```python\nfrom pathlib import Path\nfrom atomicwriter import AtomicWriter\n\ndestination = Path(\"alpha_trion.txt\")  # or str\n\nwith AtomicWriter(destination) as writer:\n    writer.write_text(\"What defines a Transformer is not the cog in his chest, \")\n    writer.write_text(\"but the Spark that resides in their core.\\n\")\n    assert destination.is_file() is False\n\nassert destination.is_file()\n```\n\nCheckout the complete documentation [here](https://ravencentric.cc/atomicwriter/api-reference/).\n\n## Installation\n\n`atomicwriter` is available on [PyPI](https://pypi.org/project/atomicwriter/), so you can simply use pip to install it.\n\n```console\npip install atomicwriter\n```\n\n## Building from source\n\nBuilding from source requires the [Rust toolchain](https://rustup.rs/) and [Python 3.9+](https://www.python.org/downloads/).\n\n- With [`uv`](https://docs.astral.sh/uv/):\n\n  ```console\n  git clone https://github.com/Ravencentric/atomicwriter\n  cd atomicwriter\n  uv build\n  ```\n\n- With [`pypa/build`](https://github.com/pypa/build):\n\n  ```console\n  git clone https://github.com/Ravencentric/atomicwriter\n  cd atomicwriter\n  python -m build\n  ```\n\n## Acknowledgements\n\nThis project is essentially a thin wrapper around the excellent [`tempfile`](https://crates.io/crates/tempfile) crate, which handles all the heavy lifting for atomic file operations.\n\nIt is also heavily inspired by the now-archived [`atomicwrites`](https://pypi.org/project/atomicwrites/) project and uses a similar API.\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/Ravencentric/atomicwriter/blob/main/LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](https://github.com/Ravencentric/atomicwriter/blob/main/LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contributing\n\nContributions are welcome! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravencentric%2Fatomicwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravencentric%2Fatomicwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravencentric%2Fatomicwriter/lists"}