Giter Club home page Giter Club logo

autotui's Introduction

autotui's People

Contributors

seanbreckenridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autotui's Issues

dangerous default values

I don't think it particularly matters in any of these, but probably a good idea to remove these to prevent possible annoying global state issues

$ pylint ./autotui/*.py | grep -i 'dangerous'
autotui/fileio.py:15:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:15:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:30:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:30:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:47:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:47:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:69:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/fileio.py:69:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/namedtuple_prompt.py:137:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/namedtuple_prompt.py:137:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/namedtuple_prompt.py:219:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/namedtuple_prompt.py:219:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/serialize.py:53:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/serialize.py:53:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/serialize.py:156:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/serialize.py:156:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:38:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:38:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:63:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:63:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:88:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:88:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:88:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:88:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:88:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
autotui/shortcuts.py:88:0: W0102: Dangerous default value {} as argument (dangerous-default-value)

add buffer type

is still a string, but would open using click.edit, e.g. open vim so you can write out a journal entry/note etc

should add a autotui.customtypes module which handles that

not sure how that works with type aliases/if i have to check the name of the item/can create a new type with typing.Type

support typing.Any?

would pretty much just dump/load the JSON primitives, but don't see any reason not to support it

create benchmark

Create some benchmark that has a variety of types, loading and serializing info back to JSON, so its possible to see where performance improvements could be made

interactive editor?

could load stuff in, fuzzy match to select one of the items with prompt_toolkit, pick a field to edit, and then modify and write back

instead of editing the json file manually

add yaml support

pretty sure its a superset of JSON, so shouldnt have any issues with the parser

could be nice to be able to copy around blocks of text without worrying about trailing commas

accept timezones for datetime?

probably dont want to serialize the timezone, could cause a bunch of issues

but, could optionally accept a timezone as an kwarg when deserializing, to use instead of UTC

mypy issue: fix union types

Not totally sure how to fix the issue with binding a TypeVar with Union types across the same function signature:

$ mypy ./examples

examples/timedelta_serializer.py:81: error: Dict entry 0 has
incompatible type "Type[timedelta]": "Callable[[int], timedelta]";
expected "Type[Any]":
"Callable[[Union[str, int, float, bool, datetime, Dict[Any, Any]]], Any]"
 [dict-item]
            timedelta: from_seconds,
            ^
examples/timedelta_serializer.py:90: error: Dict entry 0 has
incompatible type "str": "Callable[[int], timedelta]"; expected "str":
"Callable[[Union[str, int, float, bool, datetime, Dict[Any, Any]]], Any]"
 [dict-item]
            "duration": from_seconds,
            ^
Found 2 errors in 1 file (checked 6 source files)

support recursive serialization/deserialization

This isnt as complicated as I had originally thought, just need to add additional cases to check if an items expected type for a field is a NamedTuple before the base case in the _serialize_type and _deserialize_type functions

https://github.com/seanbreckenridge/autotui/blob/master/autotui/serialize.py#L46

https://github.com/seanbreckenridge/autotui/blob/master/autotui/serialize.py#L152

Could fail if you have a NT nested deeper than sys.getrecursionlimit(), but not going to worry about that

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.