Skip to content

Instantly share code, notes, and snippets.

@genadyp
genadyp / setup.cfg
Created June 29, 2021 10:24
setup.cfg
# https://github.com/pypa/build/blob/main/setup.cfg
[metadata]
name = build
version = 0.5.1
description = A simple, correct PEP517 package builder
long_description = file: README.md
long_description_content_type = text/markdown
author = Filipe Laíns
author_email = [email protected]
@genadyp
genadyp / .editorconfig
Created June 14, 2021 04:18
editorconfig
# see https://editorconfig.org/
root = true
[*]
# Use Unix-style newlines for most files (except Windows files, see below).
end_of_line = lf
trim_trailing_whitespace = true
indent_style = space
insert_final_newline = true
indent_size = 4
@genadyp
genadyp / tasks_01.py
Last active July 1, 2021 19:21
invoke python tasks
"""
Tasks for maintaining the project.
https://github.com/fedejaure/cookiecutter-modern-pypackage
Execute 'invoke --list' for guidance on using Invoke
"""
import platform
import webbrowser
from pathlib import Path
@genadyp
genadyp / immutabledict.py
Created June 10, 2021 08:47 — forked from glyphobet/immutabledict.py
Immutable dictionary in Python
class ImmutableDict(dict):
def __setitem__(self, key, value):
raise TypeError("%r object does not support item assignment" % type(self).__name__)
def __delitem__(self, key):
raise TypeError("%r object does not support item deletion" % type(self).__name__)
def __getattribute__(self, attribute):
if attribute in ('clear', 'update', 'pop', 'popitem', 'setdefault'):
raise AttributeError("%r object has no attribute %r" % (type(self).__name__, attribute))
# https://github.com/Pylons/pyramid/blob/master/pyproject.toml
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 79
skip-string-normalization = true
py36 = false
@genadyp
genadyp / tree-md.md
Last active April 8, 2026 23:03
represent a directory tree structure in markdown

link

#!/bin/bash

#File: tree-md

tree=$(tree -tf --noreport -I '*~' --charset ascii $1 |
@genadyp
genadyp / flask skeleton folder tree
Created May 24, 2021 08:31 — forked from efazati/Py Flask Skeleton
flask folders and files structure
.
├── deploy.py
├── project
│   ├── application.py
│   ├── apps
│   │   ├── articles
│   │   │   ├── forms.py
│   │   │   ├── __init__.py
│   │   │   ├── models.py
│   │   │   └── views.py
@genadyp
genadyp / setup.cfg
Created May 19, 2021 15:13 — forked from althonos/setup.cfg
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = [email protected]
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@genadyp
genadyp / Makefile
Created May 18, 2021 14:06 — forked from rochacbruno/Makefile
Python Setup Tips and Tricks http://j.mp/setup_py
.PHONY: test install pep8 release clean
test: pep8
py.test --cov -l --tb=short --maxfail=1 program/
install:
python setup.py develop
pep8:
@flake8 program --ignore=F403 --exclude=junk
@genadyp
genadyp / async_kafka_consumer.py
Created April 13, 2021 06:49
async kafka consumer
import asyncio
import functools
import logging
import signal
import sys
import confluent_kafka
# source: https://github.com/confluentinc/confluent-kafka-python/issues/1017