-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package maintenance update with 3 new tools
* Fix for issue #2 (windows) * Fixed UI PEP typo * Added pip-describe (requests) - get full descriptions of not installed packages * Added pyOSinfo - to get os,platform info * Added pyfileinfo - to get python-based stat info * General code and README cleanup * Updated color-highlight scheme
- Loading branch information
Showing
6 changed files
with
313 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python3 | ||
# pip-describe - Show full text package description from PyPI | ||
# -*- coding: utf-8 -*- | ||
#---------------------------------------------------------------------- | ||
# File Name : pip-describe | ||
# Author : E:V:A | ||
# Last Modified : 2018-12-01 | ||
# Version : 1.0.0 | ||
# License : GPLv3 | ||
# URL : https://github.com/E3V3A/pip-date | ||
#---------------------------------------------------------------------- | ||
# NOTE: We don't do the summary as it is already available | ||
# from the `pip search` results. | ||
# [ ] But we can always add CLI switch `-s` for summary | ||
#---------------------------------------------------------------------- | ||
import sys | ||
#import requests as req | ||
|
||
try: | ||
import requests as req | ||
except ModuleNotFoundError as err: | ||
print("\nThis program need the \"requests\" package to work.") | ||
print("Please download and install from:\nhttps://github.com/requests/requests") | ||
print(err) | ||
sys.exit(1) | ||
|
||
__version__ = '1.0.0' | ||
|
||
def usage() : | ||
print("\n Usage: %s <package-name>\n" % sys.argv[0]) | ||
print(" This will return the full-text package description (usually the README)") | ||
print(" as found on PyPI, for any given <package-name>.\n") | ||
print(" This script is part of the pip-date package at:") | ||
print(" https://github.com/E3V3A/pip-date/\n") | ||
sys.exit(2) | ||
|
||
narg = len(sys.argv) - 1 | ||
if narg == 1: | ||
pkg = sys.argv[1] | ||
else: | ||
usage() | ||
|
||
url = 'https://pypi.org/pypi/%s/json' % pkg | ||
res = req.get(url) | ||
if res.status_code == 200: | ||
dat = res.json() | ||
#smm = dat['info']['summary'].strip() # (short) description | ||
des = dat['info']['description'].strip() # long_description (often full README) | ||
print("\nPackage Description:") | ||
print("-"*80) | ||
print("%s" % des) | ||
print("-"*80) | ||
else: | ||
print('\nERROR (%s): Package \"%s\" doesn\'t exist!' % (res.status_code,pkg)) | ||
sys.exit(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env python3 | ||
# pyOSinfo - Show what Python3 thinks about your system environment | ||
# -*- coding: utf-8 -*- | ||
#---------------------------------------------------------------------- | ||
# File Name : pyOSinfo | ||
# Author : E:V:A | ||
# Last Modified : 2018-12-01 | ||
# Version : 1.0.0 | ||
# License : GPLv3 | ||
# URL : https://github.com/E3V3A/pip-date/ | ||
# Description : Show some system, os and platform information as seen by python3 | ||
#---------------------------------------------------------------------- | ||
import os, sys, platform, site | ||
from os.path import join | ||
|
||
__version__ = '1.0.0' | ||
|
||
TRUECOLOR = "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m" | ||
|
||
print("\nCurrent OS variables as seen by Python3 (%s)\n" % platform.python_version() ) | ||
print('os.getenv(\"TERM\"): %s' % os.getenv("TERM")) # [xterm, xterm-color, xterm-256color] | ||
print('os.name: %s' % os.name ) # [posix, nt, java] | ||
print('os.sys.platform: %s' % os.sys.platform ) # [linux, win32, cygwin, darwin] | ||
print('sys.platform: %s' % sys.platform ) # [linux, win32, cygwin, darwin] | ||
print('TRUECOLOR (orange): %s' % TRUECOLOR ) # TRUECOLOR written in nice orange | ||
|
||
print('\nos.uname:') # sysname, nodename, release, version, machine | ||
print('\tnodename: %s' % os.uname()[1] ) # | ||
print('\tmachine: %s' % os.uname()[4] ) # | ||
print('\tsysname: %s' % os.uname()[0] ) # | ||
print('\trelease: %s' % os.uname()[2] ) # | ||
print('\tversion: %s' % os.uname()[3] ) # | ||
|
||
print('\nplatform:') | ||
print('\tnode: %s' % platform.node() ) | ||
print('\tmachine: %s' % platform.machine() ) | ||
print('\tprocessor: %s' % platform.processor() ) | ||
print('\tsystem: %s' % platform.system() ) | ||
print('\trelease: %s' % platform.release() ) | ||
print('\tversion: %s' % platform.version() ) | ||
print('\tplatform: %s' % platform.platform() ) | ||
print('\n\tuname (6): (%s,%s,%s,%s,%s,%s)' % platform.uname() ) # (system, node, release, version, machine, processor) | ||
print('\tarchitecture (2): (%s,%s)' % platform.architecture() ) # (bits, linkage) | ||
#print('\twin32_ver (4): (%s,%s,%s,%s)' % platform.win32_ver() ) # (release, version, csd, ptype) | ||
|
||
print("\nsite:") | ||
print("\tgetsitepackages[0]: %s" % site.getsitepackages()[0]) | ||
print("\tPREFIXES (2): %s" % site.PREFIXES) | ||
print("\tUSER_SITE: %s" % site.USER_SITE) | ||
print("\tUSER_BASE: %s" % site.USER_BASE) | ||
|
||
print('\nsys.path:\n\t%s\n' % ('\n\t'.join(sys.path)) ) | ||
|
||
sys.exit(0) |
Oops, something went wrong.