Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Deadbeat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
713
Warden
Deadbeat
Commits
38d02162
Commit
38d02162
authored
Jun 12, 2018
by
Pavel Kácha
Browse files
Options
Downloads
Patches
Plain Diff
Remove inline docstring example (makes more sense within main manual document)
parent
7f62345d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
deadbeat/__init__.py
+1
-43
1 addition, 43 deletions
deadbeat/__init__.py
with
1 addition
and
43 deletions
deadbeat/__init__.py
+
1
−
43
View file @
38d02162
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
"""
DeadBeat - Framework for event driven data transformation scripts.
"""
DeadBeat
========
Framework for event driven data transformation scripts.
Example usage
-------------
::
import sys
import sys
from deadbeat import movement, log, conf, dns, text, fs
name =
"
IP_Resolve
"
description =
"
Proof-of-concept bulk IP resolver
"
conf_def = conf.cfg_root((
conf.cfg_item(
"
input_files
"
, conf.cast_path_list,
"
Input log files
"
, default=
"
test-input.txt
"
),
conf.cfg_item(
"
output_file
"
, str,
"
Output file
"
, default=
"
test-output.txt
"
),
conf.cfg_section(
"
log
"
, log.log_base_config,
"
Logging
"
),
conf.cfg_section(
"
config
"
, conf.cfg_base_config,
"
Configuration
"
)
))
def main():
cfg = conf.gather(typedef=conf_def, name=name, description=description)
log.configure(**cfg.log)
train = movement.Train()
file_watcher = fs.FileWatcherSupply(train.esc, filenames=cfg.input_files, tail=True)
csv_parse = text.CSVParse(fieldnames=(
"
ip
"
,))
resolve = dns.IPtoPTR(train.esc)
serialise = text.CSVMarshall(fieldnames=(
"
ip
"
,
"
hostnames
"
))
output = fs.LineFileDrain(train=train, path=cfg.output_file, timestamp=False, flush=False)
train.update(movement.train_line(file_watcher, csv_parse, resolve, serialise, output))
train()
if __name__ ==
'
__main__
'
:
sys.exit(main())
"""
from
__future__
import
absolute_import
,
division
,
print_function
from
__future__
import
absolute_import
,
division
,
print_function
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment