A tool to copy sqlite databases you don't own
Project description
WORK IN PROGRESS
The core here is my first attempt at a solution of this, combining ideas from browser_history.py and karlicoss/HPI/sqlite.py
to attempt to create a library/CLI tool to (as safely as possible) copy databases which may be in use from other applications.
sqlite_backup
This exposes the python stdlib sqlite.backup
function as a library, with a couple extra steps.
The main purpose for writing this is to copy sqlite databases that you may not own -- perhaps it belongs to an application (your browser) and is locked since that's currently open, or the OS keeps it open while the computer is active (e.g. Mac with iMessage)
Features
- Has the option (true by default) to first atomically copy the database from disk to a temporary directory, which is:
- useful case the source is in write-only mode
- safer if you're especially worried about corrupting or losing data
- Uses
Cpython
s conn.backup, which directly uses the underlying Sqlite C code
In short, this prioritizes safety of the data over speed or performance -- because we often don't know what the application may be doing while we're copying underlying sqlite databases
This was extracted out of the karlicoss/HPI
sqlite
module
If other tools exist to do this, please let me know!
Installation
Requires python3.7+
To install with pip, run:
pip install sqlite_backup
Usage
TODO: Fill this out
Usage: ...
Tests
git clone 'https://github.com/seanbreckenridge/sqlite_backup'
cd ./sqlite_backup
pip install '.[testing]'
mypy ./sqlite_backup
pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sqlite_backup-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 010574cb220ccbeaf17e3eb6366ecde369e7fdd8ab3388cbd84bfd6a11c81502 |
|
MD5 | b494d617a13fd887d88c5cc9d04c45ad |
|
BLAKE2b-256 | 834310cc41b63b49631d4729bb3cdb353636505cdfafa002ccf7975e23fdb21d |