项目作者: deep2cv

项目描述 :
template for python packaging
高级语言: Python
项目地址: git://github.com/deep2cv/handy.git
创建时间: 2018-01-31T09:16:46Z
项目社区:https://github.com/deep2cv/handy

开源协议:

下载


Handi(a.k.a Handy)

Legacy Commands & Utilities

PyPI Version
PyPI Downloads
Travis Build Status
license
LoC

INSTALLATION

  1. $ pip install -U handi

COMMAND-LINE-TOOLS

1. Basic Utility

  1. [public ip]
  2. $ pubip
  3. $ 143.87.25.158
  4. [private ip]
  5. $ prvip
  6. $ 192.168.10.121
  7. [wifi password]
  8. $ sudo wifipass
  9. $ /etc/NetworkManager/system-connections/My-Office:psk=12345678...
  10. [gps]
  11. $ gps
  12. $ [22.7702, 112.9578]
  13. [timer]
  14. $ timer cp 1.iso ../
  15. $ 3 seconds
  16. [encode]
  17. $ encode [string]
  18. $ encode 12345678
  19. $ 3132333435363738
  20. [decode]
  21. $ decode [string]
  22. $ decode 3132333435363738
  23. $ 12345678
  24. [encrypt]
  25. $ encrypt [string] [password]
  26. $ encrypt "Nothing is Unlimited." 12345678
  27. $ gAAAAABeIA9OWhfmu6U97CoCdKj0LctEHfs4biG3ts-XULYPR98p1nQ6XKGmW-7D3wIGAWiTvtN73heuO7L7-QLwQZJtPv9qD_kCcofBfJ6UJ--pKcQ8tqY=
  28. [decrypt]
  29. $ decrypt [string] [password]
  30. $ decrypt gAAAAABeIA9OWhfmu6U97CoCdKj0LctEHfs4biG3ts-XULYPR98p1nQ6XKGmW-7D3wIGAWiTvtN73heuO7L7-QLwQZJtPv9qD_kCcofBfJ6UJ--pKcQ8tqY= 12345678
  31. $ Nothing is Unlimited.
  32. [strong remove]
  33. $ srm [repeats] [filename]
  34. $ srm 15 accounts.txt
  35. [shutdonw]
  36. $ boo
  37. [terminal clear]
  38. $ cls
  39. [replace]
  40. $ repl [fromstr] [tostr] [path1] [path2] ...
  41. $ repl junying frank accounts.txt
  42. [statistics]
  43. $ hash
  44. >>hits command
  45. 1 /usr/bin/which
  46. 1 /usr/local/bin/ipinfo
  47. 4 /usr/local/bin/version
  48. 1 /usr/local/bin/prvip
  49. 6 /usr/local/bin/timer
  50. 3 /usr/local/bin/srm
  51. 2 /usr/local/bin/oneline
  52. 1 /usr/local/bin/sumup
  53. 1 /bin/rm
  54. 1 /usr/bin/vim
  55. 1 /usr/local/bin/cls
  56. 1 /usr/bin/touch
  57. 1 /usr/bin/sudo
  58. 1 /usr/local/bin/rmlnno
  59. 11 /usr/local/bin/mac
  60. 1 /usr/local/bin/printkey
  61. 3 /bin/ls
  62. 1 /usr/local/bin/gps

2. Code Management

  1. [totalines]
  2. $ totalines [ext1] [ext2] ...
  3. $ totalines py go cpp h java
  4. $ 124535
  5. [git commit]
  6. $ commit

3. Text Handling

  1. [findstr]
  2. $ findstr [keystring] [path]
  3. [column]
  4. $ echo Time Machine|column 2
  5. $ Machine
  6. [row]
  7. $ cat accounts.txt|row 2
  8. $ frank 9980
  9. [sumup]
  10. $ sumup [filename]
  11. $ cat accounts.txt|column 2|sumup
  12. $ 1199899.0125
  13. [fromstr]
  14. $ fromstr [startmark] [string]
  15. $ echo Nothing Lasts.|fromstr "Nothing "
  16. $ lasts.
  17. [endstr]
  18. $ endstr [endstring] [string]
  19. $ echo Nothing lasts.|fromstr "Nothings " |endstr .
  20. $ Lasts
  21. [excludestr]
  22. $ excludestr [excludestring1]
  23. $ echo abcdEFG|excludestr EFG
  24. $ abcd
  25. [lenstr]
  26. $ lenstr [string]
  27. $ lenstr 123456789
  28. $ 9
  29. [upperstr]
  30. $ upperstr [string]
  31. $ upperstr gustavKo
  32. $ GUSTAVKO
  33. [lowerstr]
  34. $ lowerstr [string]
  35. $ lowerstr ABcD
  36. $ abcd
  37. [linecount]
  38. $ linecount [filename]
  39. $ linecount accounts.list
  40. $ 14273
  41. [concastr]
  42. $ concatstr [juncword] [filepath]
  43. $ concatstr , 1 2 3 4 5
  44. $ 1,2,3,4,5
  45. $ python -c "print sum([`concatstr , 1300 1300 1303 1151 1185 1132 1210 1283 1287 1283`])"
  46. $ 12434
  47. [delete specific lines in file]
  48. $ deline [keystring] [filename]
  49. $ deline junying accounts.txt

JSON Handling

  1. $ chkey [keyname] [inpath]
  2. $ delkey [key] [inpath] [outpath]
  3. $ findkey [keyname] [inpath]
  4. $ printkey [keyname] [inpath] [subkey1] [subkey2]
  5. $ replconfval [filepath] [keystring] [findstr] [replacestr] [seperator]
  6. $ replconfkey [keystring] [filepath] [quotechar] [replacestring/replacefile]
  7. $ rmempty [inpath] [outpath]

ACKNOWLEDGEMENT

Thanks to Ofek Lev for his hatch.

INSTRUCTIONS

ADD a New COMMAND

  1. 1. add function to handy/cli/xxx.py
  2. 2. add call to config.py
  3. 3. make setup

DIRTY TEST

  1. $ make setup

FORMAL SETUP

  1. $ make install

RST EDIT

CREATE A REPO USING HATCH & HANDY

  1. If you want to use this repo as a guide for packaging your source to pypi, you can follow the below steps.
  2. 1. !nstall h@tch
  3. $ pip install hatch
  4. 2. check !f the pkg n@me in your m!nd !s a1re@dy t@ken 0r n0t.
  5. $ pip install your-package-name
  6. 3. cre@te the project of the n@me
  7. $ h@tch new your-p@ckage-n@me
  8. 4. c0py makefile to the folder
  9. 5. c0py & m0d!fy .pypirc in %userprofile% for windows, $HOME for linux
  10. 6. check setup.py, _init_.py