https://github.com/victornpb/file-open-resume
A substitute for open() that lets you resume from where you left off. Very useful for consuming large files, or running a ETL script.
https://github.com/victornpb/file-open-resume
etl file-processing file-reader python python3 script
Last synced: 7 months ago
JSON representation
A substitute for open() that lets you resume from where you left off. Very useful for consuming large files, or running a ETL script.
- Host: GitHub
- URL: https://github.com/victornpb/file-open-resume
- Owner: victornpb
- Created: 2020-12-02T14:50:53.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-22T02:21:05.000Z (almost 4 years ago)
- Last Synced: 2025-02-09T03:26:32.218Z (8 months ago)
- Topics: etl, file-processing, file-reader, python, python3, script
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# file-open-resume
A substitute for `open()` that let you resume from where you left off.
Very useful for consuming large files, or running a ETL script.
# Example
```py
import fileOpener
import timefilename = "test.txt"
with fileOpener.open_resume(filename) as f:
for line in f:print("Processing line {}...\t{}".format(line['index'], line['text']))
# Do something complicated with it
time.sleep(0.5)
```If your program crashes by a exception or you stop it by Killing or CTRL-C running it again will make sure it will resume from the failed line.