Skip to content

Commit

Permalink
Add first version of this toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyuanzhen committed Feb 13, 2022
1 parent 65d09a3 commit 5f1d136
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
dist
zyz.egg-info
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
all: clean check_setup build_bdist pypi_upload
@echo "All in one workflow"

check_setup:
@python3 setup.py check

build_sdist: check_setup
@echo "build sdist:"
@python3 setup.py sdist

build_bdist: check_setup
@echo "build bdist_wheel:"
@python3 setup.py bdist_wheel

pypi_upload: build_bdist
@echo "Upload to PyPI:"
@twine upload dist/*

clean:
@echo "Clean workspace:"
rm -fr build dist zhouyuanzhen.egg-info
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# zyztk

[<img src="https://avatars2.githubusercontent.com/u/54104471" align="right" width="200">](https://github.com/zhouyuanzhen)

My Python Toolkit

## Quick Start

### Install pip package

```shell
pip install -U zyz
```

### Work with the package

```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import zyz

zyz.help()
```
34 changes: 34 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Yuanzhen Zhou 's Python Toolkit
"""

from setuptools import setup, find_packages

LONG_DESC = """
Python Toolkit of Yuanzhen Zhou.
"""

setup(
name='zyz',
version='0.2.0',
license='Apache License 2.0',
keywords='zyz, zyztk, zhouyuanzhen',
maintainer='Yuanzhen Zhou',
maintainer_email='[email protected]',
packages=find_packages(include=['zyz', 'zyz.*']),
zip_safe=False,
include_package_data=True,
url='https://github.com/zhouyuanzhen/zyztk',
author='Yuanzhen Zhou',
author_email='[email protected]',
description='Python Toolkit of Yuanzhen Zhou',
long_description=LONG_DESC,
python_requires='>=3.5, <4',
install_requires=[],
extras_require={
'test': [
'pytest',
'coverage',
],
},
)
15 changes: 15 additions & 0 deletions zyz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys
import os

sys.path.append(os.path.dirname(os.path.abspath(__file__)))


def help():

print("************************************************\n")
print("Help:\n")
print("* Install zyz package:")
print("pip install -U zyz -i https://pypi.python.org/pypi\n")
print("* Use with zyz package:")
print("python -c 'import zyz;zyz.help()'\n")
print("************************************************\n")
9 changes: 9 additions & 0 deletions zyz/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

def get_public_ip():

import urllib.request
import ssl

ssl._create_default_https_context = ssl._create_unverified_context

return urllib.request.urlopen("https://ifconfig.me/ip").read().decode()

0 comments on commit 5f1d136

Please sign in to comment.