=====================================================================

--- Changes ------------------------------

- python library functions moved to `py/lib`
- python scwrypts renamed in kebob-case to help prevent import
- __name__ == '__main__' enforced on all python scwrypts

--- New Features -------------------------

- `__override` variables now allow values to be force-overwritten
- py.lib.http.client provides a slim `requests.request` wrapper

--- New Scripts --------------------------

py/data/convert )
  quick data converters
   - csv-to-json
   - csv-to-yaml
   - json-to-csv
   - json-to-yaml
   - yaml-to-csv
   - yaml-to-json

py/linear )
  uses the linear.app graphql API for PM tasks
   - comment

--- Bug Fixes ----------------------------

- `scwrypts` handles arguments with quotes and special characters
This commit is contained in:
2023-01-11 17:09:59 -07:00
parent a1256bb0af
commit 7617c938b1
35 changed files with 395 additions and 22 deletions

View File

@ -1,15 +0,0 @@
from redis import StrictRedis
from py.scwrypts import getenv
class RedisClient(StrictRedis):
def __init__(self):
super().__init__(
host = getenv('REDIS_HOST'),
port = getenv('REDIS_PORT'),
password = getenv('REDIS_AUTH', required=False),
decode_responses = True,
)
Client = RedisClient()

View File

@ -1,11 +1,19 @@
#!/usr/bin/env python
from argparse import ArgumentParser
from py.redis.client import Client
from py.scwrypts import interactive, getenv
from py.lib.redis.client import Client
from py.lib.scwrypts import interactive, getenv
if __name__ != '__main__':
raise Exception('executable only; must run through scwrypts')
parser = ArgumentParser(description = 'establishes a redis client in an interactive python shell')
args = parser.parse_args()
@interactive
def main():
# pylint: disable=possibly-unused-variable
r = Client
print(f'''
@ -14,6 +22,4 @@ def main():
return locals()
if __name__ == '__main__':
main()
main()