Commit 0d836508 authored by Christian Lölkes's avatar Christian Lölkes
Browse files

Initial commit

parents
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# Infobeamer stuff
config.json
image0.jpg
image1.jpg
image2.jpg
image3.jpg
image4.jpg
image5.jpg
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.0.0] 2019-03-01
- Initial release
Copyright 2017 Christian Lölkes
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ibtoolbox
import pytz
from datetime import datetime
class Toolbox():
TIMEZONE = pytz.timezone('Europe/Berlin')
@staticmethod
def utc_time():
now = datetime.utcnow()
return now.strftime('%X')
@staticmethod
def local_date():
now = datetime.utcnow()
now = now.replace(tzinfo=pytz.utc)
now = now.astimezone(Toolbox.TIMEZONE)
return now
@staticmethod
def local_formatted_time():
return Toolbox.local_date().strftime('%X')
@staticmethod
def local_formatted_date():
return Toolbox.local_date().strftime('%x')
@staticmethod
def local_formatted_long_date():
return Toolbox.local_date().strftime('%A %d. %B %Y')
@staticmethod
def week_number():
return Toolbox.local_date().strftime('%U')
@staticmethod
def local_full_formatted_date():
return Toolbox.local_date().strftime('%X - %A %d. %B %Y')
from ibtoolbox import *
if __name__ == '__main__':
print(Toolbox.local_formatted_time())
print(Toolbox.local_formatted_date())
print(Toolbox.local_formatted_long_date())
print(Toolbox.week_number())
print(Toolbox.local_full_formatted_date())
# coding=utf-8
# Copyright 2019 Christian Lölkes
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ibtools',
version='1.0.0',
author='Christian Lölkes',
author_email='christian.loelkes@gmail.com',
description='Tools for my info-beamer projects',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://hertz-gitlab.zkm.de/rapid-prototyping-lab/python-modules/info-beamer-tools.git',
packages=setuptools.find_packages(),
classifiers=[
'Programming Language :: Python :: 2',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
python_requires='>=2.7',
install_requires=[
'pytz',
],
)
Supports Markdown
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