I hereby claim:
- I am vlcinsky on github.
- I am vlcinsky (https://keybase.io/vlcinsky) on keybase.
- I have a public key ASCnbRr-ve9t3Vb2dPBwo8lMftVKos2jXs4Q6PlcgfZw4go
To claim this, I am signing this object:
| [tool.poetry] | |
| name = "pytestver" | |
| version = "0.1.0" | |
| description = "" | |
| authors = ["Jan Vlcinsky <jan.vlcinsky@tamtamresearch.com>"] | |
| [tool.poetry.dependencies] | |
| python = "^3.10" | |
| [tool.poetry.dev-dependencies] |
| [tool.poetry] | |
| name = "jinjatest" | |
| version = "0.1.0" | |
| description = "" | |
| authors = ["Jan Vlcinsky <jan.vlcinsky@tamtamresearch.com>"] | |
| [tool.poetry.dependencies] | |
| python = "^3.7" | |
| [tool.poetry.dev-dependencies] |
| import json | |
| import boto3 | |
| class S3JsonBucket: | |
| def __init__(self, bucket_name): | |
| self.bucket = boto3.resource("s3").Bucket(bucket_name) | |
| def load(self, key): |
| import os | |
| def task_one(): | |
| def create_cmd_string(a, b, target): | |
| return "echo a: %s b: %s > %s" % (a, b, target) | |
| with open("list_of_input_filenames.txt") as f: | |
| fnames = [line.strip() for line in f.readlines() if line] | |
| for a in fnames: |
I hereby claim:
To claim this, I am signing this object:
| import web | |
| import time | |
| urls = ( | |
| "/", "streamer", | |
| ) | |
| app = web.application(urls, globals()) | |
| class streamer: |
| """ | |
| Usage: | |
| csv2sql.py [--table <tablename>] <csvfile> | |
| Options: | |
| --table <tablename> Name of table in database to import into [default: mytable] | |
| Convert csv file with iperf data into sql script for importing | |
| those data into MySQL database. | |
| """ |
| """ A study, how to create plac annotated command line script from bare function | |
| preserving original function intact. | |
| This is sometime needed, when the same function is used for call e.g. by a celery, | |
| and for manual testing it is handy to have it in command line version. | |
| Usually, the code (producing only annotated command line tool) looks like:: | |
| import plac |
| def calculate_age_in_minutes(rec_time, pub_time): | |
| """ | |
| pub_time .. string with datetime in ISO 8601 format. Time, when is the feed published (mostly current time). | |
| rec_time .. string with datetime in ISO 8601 format. Time, when record was created. | |
| sample ISO string: 2011-10-25T13:55:42.123Z | |
| return .. integer with duration between pub_time and rec_time expressed in minutes | |
| """ | |
| #parsing pub_time to datetime structure. Ignoring timezone and fractions of seconds | |
| pub_t = datetime.datetime.strptime(pub_time[:19],"%Y-%m-%dT%H:%M:%S") |
| def versioned_bucket_lister(bucket, prefix='', delimiter='', | |
| key_marker='', version_id_marker='', headers=None): | |
| """ | |
| A generator function for listing versions in a bucket. | |
| """ | |
| more_results = True | |
| k = None | |
| while more_results: | |
| rs = bucket.get_all_versions(prefix=prefix, key_marker=key_marker, | |
| version_id_marker=version_id_marker, |