Commit 1ed01f7f authored by Cyb3r Jak3's avatar Cyb3r Jak3
Browse files

Version 2.2.3

parent fbb784c2
version = 1
test_patterns = [
"MetaStalk/**",
]
exclude_patterns = [
"tests/*"
]
[[transformers]]
name = "black"
enabled = true
[[analyzers]]
name = "python"
......
......@@ -15,36 +15,41 @@ license_scanning:
- if: '$CI_COMMIT_BRANCH == "master"'
when: always
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
.lint:
stage: lint
before_script:
- pip install -U pip tox --quiet
- pip install -U pip
- pip install --cache-dir=~/.cache/pip/ -r requirements-dev.txt
script:
- black --check ./MetaStalk/
- pylint --rcfile=tox.ini ./MetaStalk/
- flake8 ./MetaStalk/
- bandit -r ./MetaStalk/
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- ~/.cache/pip/
python-3.6-lint:
extends: ".lint"
image: python:3.6
script: tox -e py36
cache:
paths:
- /builds/Cyb3r-Jak3/metastalk/.tox/py36
python-3.7-lint:
extends: ".lint"
image: python:3.7
script: tox -e py37
cache:
paths:
- /builds/Cyb3r-Jak3/metastalk/.tox/py37
python-3.8-lint:
extends: ".lint"
image: python:3.8
script: tox -e py38
cache:
paths:
- /builds/Cyb3r-Jak3/metastalk/.tox/py38
python-3.9-lint:
extends: ".lint"
image: python:3.9
Coverage:
image: registry.gitlab.com/cyb3r-jak3/orca-test-image/orca-test-image:latest
allow_failure: true # Needed as the deepsource sometimes fails
......@@ -53,10 +58,8 @@ Coverage:
- python-3.6-lint
- python-3.7-lint
- python-3.8-lint
- python-3.9-lint
coverage: '/TOTAL\s*\d*\s*\d*\s*(\d*)%/'
cache:
paths:
- /builds/Cyb3r-Jak3/metastalk/.tox/coverage/*
artifacts:
paths:
- MetaStalk.log
......@@ -85,6 +88,7 @@ orca_test:
- python-3.6-lint
- python-3.7-lint
- python-3.8-lint
- python-3.9-lint
artifacts:
paths:
- metastalk_exports/**
......@@ -130,6 +134,13 @@ python-3.8-build:
extends: ".build"
image: python:3.8
python-3.9-build:
needs:
- python-3.9-lint
extends: ".build"
image: python:3.9
.test:
stage: Test_Build
before_script:
......@@ -140,7 +151,6 @@ python-3.8-build:
- command -v metastalk
- metastalk ./ExamplePhotos/ -t -d
- metastalk ./ExamplePhotos/Panasonic_DMC-FZ30.jpg ./ExamplePhotos/DSCN0010.jpg -t -d
- pip uninstall metastalk -y; pip install .[dev] --quiet
- pip uninstall metastalk -y; pip install .[image] --quiet
- pip uninstall metastalk -y; pip install .[all] --quiet
......@@ -168,17 +178,27 @@ python-3.8-test:
extends: ".test"
image: python:3.8
python-3.9-test:
needs:
- python-3.9-build
- Coverage
- orca_test
extends: ".test"
image: python:3.9
Deploy_to_PyPi:
image: python:3.7
image: python:3.8
stage: Deploy
needs:
- python-3.6-build
- python-3.7-build
- python-3.8-build
- python-3.9-build
- python-3.6-test
- python-3.7-test
- python-3.8-test
- python-3.9-test
- Coverage
- orca_test
variables:
......
......@@ -2,15 +2,23 @@
<!-- markdownlint-disable MD024 -->
## UNRELEASED
## [v2.2.3](https://gitlab.com/Cyb3r-Jak3/metastalk/-/releases/v2.2.3) - 2020-11-28
### Added
- Python 3.9 support
### Changed
- Upgrade tox, psutil, and plotly versions.
- Upgraded dependency version.
- Made dependencies minimum version rather than exact matches
- Dropped tox from GitLab pipelines for speed improvements
### Removed
- git-legal plugin in [.codeclimate.yml](.codeclimate.yml)
- Dropped `dev` and `all` extras
## [v2.2.2](https://gitlab.com/Cyb3r-Jak3/metastalk/-/releases/v2.2.2) - 2020-07-11
......
......@@ -4,7 +4,7 @@ Thanks for reading this because I am always looking to collaborate with other pe
If you are looking to submit a pull request then please do so on [GitLab](https://gitlab.com/Cyb3r-Jak3/MetaStalk) because all development is done there. Any pull request that is opened on GitHub will be closed and I mirror it on GitLab.
Please open issues on [GitLab](https://gitlab.com/Cyb3r-Jak3/MetaStalk/issues). If you do not have a GitLab account, send then please email service desk( [incoming+cyb3r-jak3-metastalk-15263483-issue-@incoming.gitlab.com](mailto:incoming+cyb3r-jak3-metastalk-15263483-issue-@incoming.gitlab.com)).
Please open issues on [GitLab](https://gitlab.com/Cyb3r-Jak3/MetaStalk/issues). If you do not have a GitLab account, send then please email [service desk](mailto:incoming+cyb3r-jak3-metastalk-15263483-issue-@incoming.gitlab.com).
## Getting starting
......@@ -17,7 +17,8 @@ git clone https://gitlab.com/Cyb3r-Jak3/metastalk.git
cd metastalk
# Recommended to use a virtualenv
pip install .[dev]
pip install -r requirements-dev.txt
pip install -e .
```
## Testing
......
......@@ -2,5 +2,5 @@
---
MetaStalk is a program that parse image metadata and creates charts from it.
"""
__version__ = "2.2.2"
__version__ = "2.2.3"
__author__ = "Cyb3r Jak3"
# -*- coding: utf-8 -*-
"""Main function of MetaStalk.
Run get any metadata from photos
and creates graphs from the metadata using MetaStalk.Modules"""
and creates graphs from the metadata using MetaStalk.Modules
"""
import argparse
from collections import OrderedDict
import os
......@@ -14,7 +15,7 @@ import MetaStalk.modules as modules
class MetaStalk:
"""MetaStalk
"""MetaStalk.
---
Main Class for all MetaStalk work
......@@ -27,7 +28,7 @@ class MetaStalk:
self.plots = {}
def run(self, args: argparse.Namespace) -> None:
""" run function
"""Run function.
Process files and passes the information on utils.graph to generates graphs.
Will also pass plots to utils.export if the flag is set.
......@@ -56,7 +57,7 @@ class MetaStalk:
utils.graph(self.plots, self.t_start, args.test, args.no_open)
def parse_files(self, path_list: list) -> None:
"""
"""Parses the files.
Use to complete the directory parsing and file adding. Does not return anything
but adds the files to to either the invalid or valid list.
......@@ -76,7 +77,7 @@ class MetaStalk:
self.exif_check(path)
def exif_check(self, file_path: str) -> None:
"""exif_check
"""exif_check.
Used to append files if the path is not a directory.
......@@ -102,7 +103,7 @@ class MetaStalk:
def start():
""" start
"""Start
---
Function needed to start MetaStalk. Does all the argument parsing.
......
......@@ -6,7 +6,7 @@ log = logging.getLogger("MetaStalk")
def date_time(photos: list) -> go.Figure():
"""date_time
"""date_time.
Makes a table with timestamp of photos.
There are three name that DateTime data can be under `Creation date`,
......
"""Makes geo chart with plots of GPS data"""
"""Makes geo chart with plots of GPS data/"""
import logging
import plotly.express as px
......@@ -8,7 +8,7 @@ log = logging.getLogger("MetaStalk")
def gps_check(photos: list) -> px.scatter_mapbox:
"""GPS_Check
"""GPS_Check.
Takes a list of photos and creates a geo plot of them
......
......@@ -6,7 +6,7 @@ log = logging.getLogger("MetaStalk")
def create_chart(table: list, pielabel: str) -> go.Figure():
"""Create_chart
"""Create_chart.
Creates the pie chart by frequency of items in a dictionary.
......@@ -40,7 +40,7 @@ def create_chart(table: list, pielabel: str) -> go.Figure():
def pie_chart(photos: list, pietype: str) -> go.Figure():
"""PieChart
"""Pie Chart.
Parses information and returns a pie chart
......
"""Creates a table figure that shows
photos that did and did not have exif"""
photos that did and did not have exif.
"""
import logging
import plotly.graph_objects as go
......
"""utils.export
"""utils.export.
---
Exports the plots as interactive html
......@@ -8,7 +8,7 @@ import os
class export:
"""export
"""export.
---
Deals with the export to html and images. Probably not the best way to run everything but it
......@@ -27,7 +27,7 @@ class export:
self.image_export()
def directory_management(self) -> None:
"""directory_management
"""directory_management.
---
Creates directory for output if it does not exist and if it does then it will check if there
are already file in it.
......@@ -39,7 +39,7 @@ class export:
self.log.warning("The chosen output directory contain files.")
def image_export(self) -> None:
"""image_export
"""image_export.
---
Deals with export images
......@@ -50,9 +50,11 @@ class export:
for name, chart in self.plots.items():
try:
chart.write_image(f"{self.output_dir}/{name}.{self.choice}")
except ValueError:
except ValueError as err:
self.log.error("Missing packages from metastalk[image]")
raise EnvironmentError("Missing packages from metastalk[image]")
raise EnvironmentError(
"Missing packages from metastalk[image]"
) from err
def html_export(self) -> None:
"""html_export
......@@ -68,5 +70,6 @@ class export:
offline = "cdn"
for name, chart in self.plots.items():
chart.write_html(
f"{self.output_dir}/{name}.html", include_plotlyjs=offline,
f"{self.output_dir}/{name}.html",
include_plotlyjs=offline,
)
"""Makes the logger for the program"""
"""Makes the logger for the program."""
import logging
......
"""utils.parse
"""utils.parse.
---
Parse needed to make exifread dictionaries easier"""
Parse needed to make exifread dictionaries easier
"""
def gps_parse(tags: dict) -> dict:
"""Returns GPS degrees"""
"""Returns GPS degrees."""
latitude = tags["GPS GPSLatitude"]
latitude_ref = tags["GPS GPSLatitudeRef"]
longitude = tags["GPS GPSLongitude"]
......@@ -21,7 +22,7 @@ def gps_parse(tags: dict) -> dict:
def _convert_to_degrees(value) -> float:
"""
"""Degrees converter function.
Helper function to convert the GPS coordinates stored in the EXIF to degrees in float format
:param value:
:type value: exifread.utils.Ratio
......
"""Script to check for available MetaStalk updates"""
"""Script to check for available MetaStalk updates."""
from distutils.version import LooseVersion
import requests
......
"""Uses dash to create a webpage that contain all the graphs"""
"""Uses dash to create a webpage that contain all the graphs/"""
import timeit
import logging
import webbrowser
......@@ -12,7 +12,7 @@ log = logging.getLogger("MetaStalk")
def graph(plots: dict, t_start: float, test: bool, no_open: bool):
"""graph
"""Graph
Displays all the plots that are passed to it.
......
......@@ -25,6 +25,7 @@ Metastalk is supported and tested on the following Python versions:
- 3.6
- 3.7
- 3.8
- 3.9
## How to use
......@@ -89,4 +90,5 @@ metastalk <Path to files>
This is for educational/proof of concept purposes only. What you do with MetaStalk is **your** responsibility.
[![DeepSource](https://static.deepsource.io/deepsource-badge-light-mini.svg)](https://deepsource.io/gl/Cyb3r-Jak3/MetaStalk/?ref=repository-badge)
[![DeepSource](https://deepsource.io/gl/Cyb3r-Jak3/metastalk.svg/?label=active+issues&show_trend=true)](https://deepsource.io/gl/Cyb3r-Jak3/metastalk/?ref=repository-badge)
[![DeepSource](https://deepsource.io/gl/Cyb3r-Jak3/metastalk.svg/?label=resolved+issues&show_trend=true)](https://deepsource.io/gl/Cyb3r-Jak3/metastalk/?ref=repository-badge)
\ No newline at end of file
-r requirements.txt
bandit
pylint
flake8
coverage
tox
psutil >= 5.7.3
black >= 20.8b1
exifreader == 0.1.1
plotly == 4.9.0
pandas == 1.0.5
dash == 1.13.4
requests == 2.24.0
bandit == 1.6.2
pylint == 2.5.3
flake8 == 3.8.3
coverage == 5.2
tox == 3.18.0
psutil == 5.7.2
black == 19.10b0
exifreader >= 0.1.1
plotly >= 4.13.0
pandas >= 1.1.4
dash >= 1.17.0
requests >= 2.25.0
\ No newline at end of file
......@@ -3,19 +3,4 @@ download_url = https://gitlab.com/Cyb3r-Jak3/metastalk/-/releases
[options.extras_require]
image =
psutil == 5.7.2
dev =
black == 19.10b0
bandit == 1.6.2
pylint == 2.5.3
flake8 == 3.8.3
coverage == 5.2
tox == 3.18.0
all =
black == 19.10b0
bandit == 1.6.2
pylint == 2.5.0
flake8 == 3.7.9
coverage == 4.5.4
tox == 3.18.0
psutil == 5.7.2
psutil >= 5.7.3
\ No newline at end of file
......@@ -6,7 +6,8 @@ from MetaStalk import __version__, __author__
def read(fname) -> str:
"""Reads the fname file.
Used to read the README.MD file"""
Used to read the README.MD file
"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
......@@ -16,11 +17,11 @@ setup(
author=__author__,
author_email="jake@jwhite.network",
install_requires=[
"exifreader == 0.1.1",
"plotly == 4.9.0",
"pandas == 1.0.5",
"dash == 1.13.4",
"requests == 2.24.0",
"exifreader >= 0.1.1",
"plotly >= 4.13.0",
"pandas >= 1.1.4",
"dash >= 1.17.0",
"requests == 2.25.0",
],
description="Metadata analyzer and visualizer",
license="MPL 2.0",
......@@ -47,6 +48,7 @@ setup(
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Topic :: Scientific/Engineering :: Information Analysis",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment