Backup Utils
A Python utility for creating timestamped backups of Python scripts and projects.
Installation
pip install fstrent_bkitup
Usage
Backing up a single script
Place this at the very top of your script, right after your imports:
# your_script.py
import sys
import os
# ... your other imports ...
from fstrent_bkitup import backup_script
# Create backup before running the script
backup_script(__file__)
# Rest of your script below
def main():
# your code here
pass
if __name__ == "__main__":
main()
Backing up a project
For backing up multiple files or entire directories, use backup_project:
# your_script.py
import sys
import os
# ... your other imports ...
from fstrent_bkitup import backup_project
# Create backup of script and project files before running
backup_project(
__file__, # current script
additional_paths=[
'lib', # backup entire lib directory
'config.json', # backup specific files
'src' # backup src directory
],
output_dir='backups' # where to store the zip files
)
# Rest of your script below
def main():
# your code here
pass
if __name__ == "__main__":
main()
Features
- Create timestamped backups of individual Python scripts
- Create ZIP archives of entire projects including specified directories and files
- Preserve file metadata
- Configurable output directory
Backup Naming
- Single script backups:
original_name_YYYYMMDD_HHMMSS.py - Project backups:
original_name_YYYYMMDD_HHMMSS.zip
Examples
Basic Script Backup
from fstrent_bkitup import backup_script as bks
# Creates a backup in ./bkups/myscript_20240320_143022.py
bks(__file__)
# Or specify custom backup directory
bks(__file__, output_dir='my_backups')
Project Backup with Multiple Paths
from fstrent_bkitup import backup_project as bkp
# Creates a zip file in ./bkups/myscript_20240320_143022.zip
bkp(
__file__,
additional_paths=[
'lib',
'config',
'data/important.csv'
]
)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for fstrent-bkitup 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fstrent_bkitup-0.1.4.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fstrent_bkitup-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / fstrent_bkitup-0.1.4.tar.gz
| Download URL | fstrent_bkitup-0.1.4.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc441f00c4d6b2af653ef7dede2373ef725fef70b46cd1ce3fb28027d528e5ba
|
|
BLAKE2b-256 checksum How to use checksums |
75bdecadb4cd82f18c395e5642fcf7dca2f57f375059193e4fa873455e0db434
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / fstrent_bkitup-0.1.4-py3-none-any.whl
| Download URL | fstrent_bkitup-0.1.4-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f9e0ba7b72d6ee71ff49a5f9ba537009533182cc5af6cb40bc958916670f657
|
|
BLAKE2b-256 checksum How to use checksums |
cfebb8f3785fa3b31fdfec5f6d6405914aef6279a90ee9d009f4276e0d4996b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Security for fstrent-bkitup 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.