Skip to content

Commit 9ad8160

Browse files
author
joseramon.afonso
committed
Init commit
0 parents  commit 9ad8160

54 files changed

Lines changed: 2831 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
config.json
2+
local_tests/
3+
coverage_report/
4+
certs/
5+
environment.env
6+
tests_results/*
7+
!tests_results/.gitkeep
8+
!local_server_files/*
9+
check_list.txt
10+
.tmp.gz
11+
12+
.idea
13+
# Byte-compiled / optimized / DLL files
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
18+
# C extensions
19+
*.so
20+
21+
# Distribution / packaging
22+
.Python
23+
build/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib64/
30+
parts/
31+
sdist/
32+
var/
33+
wheels/
34+
*.egg-info/
35+
.installed.cfg
36+
*.egg
37+
38+
# PyInstaller
39+
# Usually these files are written by a python script from a template
40+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
41+
*.manifest
42+
*.spec
43+
44+
# Installer logs
45+
pip-log.txt
46+
pip-delete-this-directory.txt
47+
48+
# Unit test / coverage reports
49+
htmlcov/
50+
.tox/
51+
.coverage
52+
.coverage.*
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
*.cover
57+
.hypothesis/
58+
59+
# Translations
60+
*.mo
61+
*.pot
62+
63+
# Django stuff:
64+
*.log
65+
local_settings.py
66+
67+
# Flask stuff:
68+
instance/
69+
.webassets-cache
70+
71+
# Scrapy stuff:
72+
.scrapy
73+
74+
# Sphinx documentation
75+
docs/_build/
76+
77+
# PyBuilder
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# pyenv
84+
.python-version
85+
86+
# celery beat schedule file
87+
celerybeat-schedule
88+
89+
# SageMath parsed files
90+
*.sage.py
91+
92+
# Environments
93+
.env
94+
.venv
95+
env/
96+
venv/
97+
ENV/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/
111+
112+
*~
113+
.DS_Store
114+
115+
#Visual Code Studio
116+
.vscode/
117+
devo.json

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: python
2+
python:
3+
- '3.5'
4+
install:
5+
- pip install .
6+
- pip install pyyaml
7+
script:
8+
- python run_tests.py
9+
deploy:
10+
- provider: pypi
11+
user: worvast
12+
password:
13+
secure: "YkRREwI/8aEU+l++YY12WNMPatxtP6Y4J+SpWoxB8hYpNDaKSgd70eZFoyAvjbsGs740i16l4yRFuzEITdKWS99XL34V3w6dBiK+H1a8b5wuoxgWp/Y9plOrXK4sfCHTMVa4h1I3N2ZISrR0kZIFtsXlUp5Rqlu3x+pNd46mDjuwlrMBVtZiQagI43k8+G8eogzMF0CsIgEpu+gvYQQ5O8xb4naDbQfDa1DhmoDfT78QY/7dsNN/p/dUr46I7eqAeBoZq04gR7jvYI2TRPTH/tFBkNyMvW7aLCH3Rm8NUI61rQlOj86ZAPFkSkM73hL9s1Sj8HDW7dUxT14inRy047USksu4XnQ+HM0/VsqeFxwvMgwnXJxygHuDgegd0e+K+BMMenzcPUpZWb/2JAvXJD4s/RliZ0zI7OkWy/CkEahTO6cpaIuCnwx/A9pWVsHcL/8x98vShQze6IiTQVW1lcOerDEx/L2ieZs2xLTNSVch5QhKIANy8prvdypTfJsjoRUlwQEZHKMLREjR7rhRMk0JDBM8ATwBN7jgOgf7OBhwG8SC8Geu6EzUkdD/MAgCplWTUB2tXXKaPagqlEF3opEweYBhw6/BCwtWb8pk8kD4PTyM/fI8035hBN8fh8qZfJ5c3aOkGJ9Ix8SXINoRbTrg0oWbV5+rKJQJ/1D3WiA="
14+
on:
15+
tags: true
16+
python: 3.5
17+
distributions: sdist bdist_wheel
18+
repo: DevoInc/python-utils
19+
branch: master
20+
distributions: sdist bdist_wheel
21+
skip_existing: true
22+
skip_cleanup: true
23+

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [1.0.0] - 2019-01-16
8+
#### Added
9+
* On the ninth month of the year, a Devo programmer finally decided to publish a part of the Utils and rest in peace.

CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Contributing to Devo
2+
3+
There are many ways to contribute to Devo. Here are some of them:
4+
5+
6+
1. [Report bugs](#reporting-bugs) or request features in the [issue tracker](issues).
7+
2. [Submit patches](#submit-patch) for bug fixes and/or new features.
8+
9+
## Reporting bugs
10+
11+
```
12+
Please report security issues only to [email protected].
13+
This is a private email only open to Devo developers.
14+
```
15+
16+
Well-written bug reports are very helpful, keep in mind this guideline when
17+
reporting a new bug.
18+
19+
* Check the open issues to see if it has already been reported.
20+
* Write complete, reproducible, specific bug reports: the smaller the test case,
21+
better.
22+
* Includes the output of the library with all the error information
23+
24+
25+
## Submit patch
26+
To be able to make a fork and the corresponding MR you have to accept Devo's CLA
27+
The process to modify one package or script is the next:
28+
29+
1. Create your fork from release-next
30+
2. Add to the `CHANGELOG.md`, in
31+
[`Unreleased`](#How_can_I_minimize_the_effort_required?) the tasks
32+
that you are going to take or are carrying out to be able to review at a quick
33+
glance the objective of the branch.
34+
3. Make your awesome code
35+
4. Never forget to **change the changelog**.
36+
4.1 [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
37+
5. Create a Pull Request to release-next.
38+
39+
40+
## Keep a CHANGELOG
41+
##### What’s a change log?
42+
A change log is a file which contains a curated, chronologically ordered list of
43+
notable changes for each version of a project.
44+
45+
##### What’s the point of a change log?
46+
To make it easier for users and contributors to see precisely what notable
47+
changes have been made between each release (or version) of the project.
48+
49+
##### Why should I care?
50+
Because software tools are for people. If you don’t care, why are you
51+
contributing? Right, Logtrust pay you for it, but surely, there must be a kernel
52+
(ha!) of care somewhere in that lovely little brain of yours.
53+
54+
##### What makes a good change log?
55+
A good change log sticks to these principles:
56+
57+
* It’s made for humans, not machines, so legibility is crucial.
58+
* Easy to link to any section (hence Markdown over plain text).
59+
* One sub-section per version.
60+
* List releases in reverse-chronological order (newest on top).
61+
* Write all dates in `YYYY-MM-DD` format. (Example: `2012-06-02`
62+
for `June 2nd, 2012`.) It’s international, sensible, and language-independent.
63+
* Explicitly mention whether the project follows Semantic Versioning.
64+
* Each version should:
65+
* List its release date in the above format.
66+
* Group changes to describe their impact on the project, as follows:
67+
* `Added` for new features.
68+
* `Changed` for changes in existing functionality.
69+
* `Deprecated` for once-stable features removed in upcoming releases.
70+
* `Removed` for deprecated features removed in this release.
71+
* `Fixed` for any bug fixes.
72+
* `Security` to invite users to upgrade in case of vulnerabilities.
73+
74+
##### How can I minimize the effort required?
75+
76+
Always have an `Unreleased` section at the top for keeping track of any changes.
77+
78+
This serves two purposes:
79+
* People can see what changes they might expect in upcoming releases
80+
* At release time, you just have to change "Unreleased" to the version number and add a new "Unreleased" header at the top.
81+
82+
**Feel free for update and improve this document content or format.**<br/>

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (C) 2019 Devo, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
[![relese-next Build Status](https://travis-ci.com/DevoInc/python-utils.svg?branch=master)](https://travis-ci.com/DevoInc/python-utils) [![LICENSE](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/DevoInc/python-utils/blob/master/LICENSE)
2+
3+
[![wheel](https://img.shields.io/badge/wheel-yes-brightgreen.svg)](https://pypi.org/project/devo-utils/) [![version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://pypi.org/project/devo-utils/) [![python](https://img.shields.io/badge/python-3.3%20%7C%203.4%20%7C%203.5%20%7C%203.6%20%7C%203.7-blue.svg)](https://pypi.org/project/devo-utils/)
4+
5+
6+
# Devo Python Utils
7+
8+
This package it's an extra for the Devo SDK and our clients. It can be used to:
9+
* Order files.
10+
* Generate fake data.
11+
* File IO generators.
12+
13+
## Requirements
14+
15+
This package require Python 3.5+ and devo-sdk package
16+
17+
## Quick Start
18+
### Installing the package:
19+
20+
You can install the Devo SDK by using `easy_install` or `pip`:
21+
22+
#option 1
23+
easy_install devo-utils
24+
25+
#option 2
26+
pip install devo-utils
27+
28+
29+
You can use sources files, clonning the project too:
30+
31+
#option 3
32+
python setup.py install
33+
34+
#option 4
35+
pip install .
36+
37+
#option 5 - dev option
38+
pip install -e .
39+
40+
### Documentation
41+
42+
You have specific documentation in _[docs](docs)_ folder for each part of SDK:
43+
* [Faker: fake data](docs/faker.md)
44+
* [File IO](docs/io/fileio.md)
45+
* [Sorting data](docs/sorter.md)
46+
47+
48+
## Contributing
49+
See [Python Utils contributing guide](CONTRIBUTING.md).<br/>
50+
Pull requests are welcome ☺
51+
52+
## Launch tests
53+
### run_tests script
54+
You can run tests from the main folder of SDK
55+
To launch this script, you need either the environment variables loaded in the system, or the _environment.env_ file in the root of the SDK with the correct values, since to test all the SDK functionalities it is necessary to connect to Devo for the tests of sending and extracting data. You has a example file called _environment.env.example_
56+
57+
It's normal, by the way, TCP tests fails in clients or not Devo developers systems.
58+
59+
```bash
60+
~/projects/python-utils > python setup.py test
61+
```
62+
63+
```bash
64+
~/projects/python-utils > python run_tests.py
65+
```
66+
67+
You can add option "Coverage" for create HTML report about tests.
68+
69+
```bash
70+
~/projects/python-utils > python run_tests.py --coverage
71+
```
72+
73+
74+
### Run using Unittest command
75+
76+
You can see references in [unittest documentation](https://docs.python.org/3/library/unittest.html)
77+
78+
For commands like:
79+
80+
```bash
81+
python -m unittest discover -p "*.py"
82+
```
83+
84+
If you launch this command from the root directory of the SDK, you need to have the environment variables in your
85+
system for all the tests that require connection to Devo can work, not being able to use the environment.env file
86+
as in the script.
87+
88+
89+
### Contact Us
90+
91+
You can contact with us at _[email protected]_.
92+
93+
## License
94+
MIT License
95+
96+
(C) 2019 Devo, Inc.
97+
98+
Permission is hereby granted, free of charge, to any person obtaining a copy of
99+
this software and associated documentation files (the 'Software'), to deal in
100+
the Software without restriction, including without limitation the rights to
101+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
102+
the Software, and to permit persons to whom the Software is furnished to do so,
103+
subject to the following conditions:
104+
105+
The above copyright notice and this permission notice shall be included in all
106+
copies or substantial portions of the Software.
107+
108+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
109+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
110+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
111+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
112+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
113+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

devoutils/__init__.py

Whitespace-only changes.

devoutils/__version__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__description__ = 'Devo Python Library.'
2+
__url__ = 'http://www.devo.com'
3+
__version__ = "1.0.0"
4+
__author__ = 'Devo'
5+
__author_email__ = '[email protected]'
6+
__license__ = 'MIT'
7+
__copyright__ = 'Copyright 2018 Devo'

devoutils/faker/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .senders.batch_sender import BatchSender
2+
from .senders.file_sender import FileSender
3+
from .senders.syslog_sender import SyslogSender
4+
from .senders.syslog_raw_sender import SyslogRawSender
5+
from .senders.template_parser import TemplateParser

devoutils/faker/providers/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)