{"id":25343895,"url":"https://github.com/Ravencentric/atomicwriter","last_synced_at":"2025-10-29T13:31:19.553Z","repository":{"id":277355281,"uuid":"932161988","full_name":"Ravencentric/atomicfile","owner":"Ravencentric","description":"Write files atomically.","archived":false,"fork":false,"pushed_at":"2025-02-13T13:45:25.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T14:31:51.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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}},"created_at":"2025-02-13T13:24:00.000Z","updated_at":"2025-02-13T13:45:30.000Z","dependencies_parsed_at":"2025-02-13T14:33:08.612Z","dependency_job_id":"c55cfccc-63c4-4cc3-b24a-b7716028d3d8","html_url":"https://github.com/Ravencentric/atomicfile","commit_stats":null,"previous_names":["ravencentric/atomicfile"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravencentric%2Fatomicfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ravencentric","download_url":"https://codeload.github.com/Ravencentric/atomicfile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238829550,"owners_count":19537719,"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":[],"created_at":"2025-02-14T10:59:22.870Z","updated_at":"2025-10-29T13:31:19.548Z","avatar_url":"https://github.com/Ravencentric.png","language":"Python","funding_links":[],"categories":["Python"],"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"}