diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c81655 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Python +.venv/ + +# Package +test.py + +# Setuptools +build/ +dist/ +jutl.egg-info/ +**/__pycache__/ diff --git a/jutils/averages/__init__.py b/jutils/averages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/calculators/__init__.py b/jutils/calculators/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/converters/__init__.py b/jutils/converters/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/cryptography/__init__.py b/jutils/cryptography/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/formatting/__init__.py b/jutils/formatting/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/language/__init__.py b/jutils/language/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/logic/__init__.py b/jutils/logic/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/pipelining/__init__.py b/jutils/pipelining/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/sorters/__init__.py b/jutils/sorters/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/timers/__init__.py b/jutils/timers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jutils/utilities/__init__.py b/jutils/utilities/__init__.py new file mode 100644 index 0000000..5f368ea --- /dev/null +++ b/jutils/utilities/__init__.py @@ -0,0 +1,3 @@ +# Import hello_world.py from /utilities/ so hello_world() is +# usable at 'from jutils import utilities' level. +from .hello_world import hello_world \ No newline at end of file diff --git a/jutils/utilities/hello_world.py b/jutils/utilities/hello_world.py new file mode 100644 index 0000000..89e0226 --- /dev/null +++ b/jutils/utilities/hello_world.py @@ -0,0 +1,17 @@ +def hello_world(name: str = None) -> str: + """ + Greet the user. + + Returns "Hello, 'user!'" where 'user' is 'name' if passed, + or "Hello, World!" if 'name' is not passed. + + Parameters: + name (str): The user's name + + Returns: + str: A greeting for the user + """ + if name: + return(f"Hello, {name}!") + else: + return(f"Hello, World!") diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..db50f59 --- /dev/null +++ b/setup.py @@ -0,0 +1,63 @@ +# Module imports +from setuptools import setup + +# Arguments +git_name = "jutils" +pypi_name = "jutl" +version = "0.0.1" +python_version = ">=3.10" + +# Long description from README.md +with open("README.md", "r") as fh: + long_description = fh.read() + +# jutils package data +jutils_package_data = [ + 'averages/*', + 'calculators/*', + 'converters/*', + 'cryptography/*', + 'formatting/*', + 'language/*', + 'logic/*', + 'pipelining/*', + 'sorters/*', + 'timers/*', + 'utilities' +] + +# Run setup function +setup( + name=pypi_name, + version=version, + description='A Python package of useful tools and utilities.', + license='MIT', + long_description=long_description, + long_description_content_type='text/markdown', + author='Jordan Welsman', + author_email='jordan.welsman@outlook.com', + url='https://pypi.org/project/'+pypi_name+"/", + download_url='https://github.com/JordanWelsman/jutils/tags', + package_data={'jutils': jutils_package_data}, + python_requires=python_version, + # jutils package information + classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'License :: OSI Approved :: MIT License', + 'Topic :: Education', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Security', + 'Topic :: Security :: Cryptography', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Utilities', + 'Programming Language :: Python :: 3', + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11" + ], + keywords='python, averages, calculators, converters, cryptography, formatting, language, logic, pipelining, sorters, timers, utilities' +) \ No newline at end of file diff --git a/unbuild b/unbuild new file mode 100755 index 0000000..d5e10f8 --- /dev/null +++ b/unbuild @@ -0,0 +1,22 @@ +#!/bin/sh + +# jutils Unbuild Script +# To be used to delete the directories & files created by `python setup.py bdist_wheel`. + +# Author : Jordan Welsman +# Copyright : Jordan Welsman + +echo "You are about to delete files & folders from jutils." +echo "These files are crucial to the ability to install and import jutils." +read -p "Do you want to continue? [Y/n]: " + +if [[ $REPLY =~ ^[Yy]$ ]] +then + rm -rf build # remove build directory if exists + rm -rf dist # remove distribution directory if exists + rm -rf jutl.egg-info # remove egg info directory if exists + find . -name __pycache__ -type d -print0|xargs -0 rm -r -- # remove all pycache directories + echo "Project successfully unbuilt." +else + echo "Operation aborted." +fi