-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Commit: Add files via upload
Added: - pyproject.toml - README.md - /dist/smack-0.2.4-py3-none-any.whl - /dist/smack-0.2.4.tar.gz - /src/smack/smack.py - /src/smack/__init.py - /src/smack.egg-info/dependency_links.txt - /src/smack.egg-info/entry_points.txt - /src/smack.egg-info/PKG-INFO - /src/smack.egg-info/requires.txt - /src/smack.egg-info/SOURCES.txt - /src/smack.egg-info/top_level.txt - LICENSE
- Loading branch information
0 parents
commit 23b7e0c
Showing
13 changed files
with
227 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2018 The Python Packaging Authority | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,24 @@ | ||
# smack | ||
_Smack is a cli application to create package folder structures for packages based on PyPi specifications_ | ||
|
||
## Installation | ||
```bash | ||
pip install smack | ||
``` | ||
|
||
## Usage | ||
```bash | ||
smack [project-name] | ||
``` | ||
## Folder structure | ||
```bash | ||
[name]_project | ||
-src | ||
-[name] | ||
-__init__.py | ||
-[name].py | ||
-tests | ||
-LICENSE.txt | ||
-pyproject.toml | ||
-README.md | ||
``` |
Binary file not shown.
Binary file not shown.
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,25 @@ | ||
[project] | ||
name = "smack" | ||
version = "0.2.4" | ||
authors = [ | ||
{ name="Jacen Fossey", email="[email protected]" }, | ||
] | ||
description = "Creates a basic folder structure for PyPi projects" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
dependencies = [ | ||
"click" | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/JacenFossey/smack" | ||
"Bug Tracker" = "https://github.com/JacenFossey/smack/issues" | ||
|
||
[project.scripts] | ||
smack = "smack.smack:main" |
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,38 @@ | ||
Metadata-Version: 2.1 | ||
Name: smack | ||
Version: 0.2.4 | ||
Summary: Creates a basic folder structure for PyPi projects | ||
Author-email: Jacen Fossey <[email protected]> | ||
Project-URL: Homepage, https://github.com/JacenFossey/smack | ||
Project-URL: Bug Tracker, https://github.com/JacenFossey/smack/issues | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: Operating System :: OS Independent | ||
Requires-Python: >=3.7 | ||
Description-Content-Type: text/markdown | ||
License-File: LICENSE | ||
|
||
# smack | ||
_Smack is a cli application to create package folder structures for packages based on PyPi specifications_ | ||
|
||
## Installation | ||
```bash | ||
pip install smack | ||
``` | ||
|
||
## Usage | ||
```bash | ||
smack [project-name] | ||
``` | ||
## Folder structure | ||
```bash | ||
[name]_project | ||
-src | ||
-[name] | ||
-__init__.py | ||
-[name].py | ||
-tests | ||
-LICENSE.txt | ||
-pyproject.toml | ||
-README.md | ||
``` |
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,11 @@ | ||
LICENSE | ||
README.md | ||
pyproject.toml | ||
src/smack/__init__.py | ||
src/smack/smack.py | ||
src/smack.egg-info/PKG-INFO | ||
src/smack.egg-info/SOURCES.txt | ||
src/smack.egg-info/dependency_links.txt | ||
src/smack.egg-info/entry_points.txt | ||
src/smack.egg-info/requires.txt | ||
src/smack.egg-info/top_level.txt |
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 @@ | ||
|
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,2 @@ | ||
[console_scripts] | ||
smack = smack.smack:main |
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 @@ | ||
click |
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 @@ | ||
smack |
Empty file.
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,105 @@ | ||
import click | ||
import os | ||
|
||
@click.command() | ||
@click.argument('project_name', required=True) | ||
|
||
def main(project_name: str): | ||
|
||
project_title = project_name+"_project" | ||
# creates the main folder | ||
def create_main_folder(): | ||
try: | ||
os.mkdir(project_title) | ||
print(f"Directory /{project_title} created") | ||
except FileExistsError: | ||
print(f"Directory /{project_title} already exists") | ||
|
||
|
||
|
||
# creates the src folder | ||
def create_src_folder(): | ||
|
||
# current_dir/project_name | ||
cwdir = os.getcwd()+"/"+project_title | ||
|
||
try: | ||
os.mkdir(cwdir+"/src") | ||
print("Directory /src created") | ||
except FileExistsError: | ||
print("The folder /src already exists") | ||
|
||
# creates the subsrc folder | ||
def create_subsrc_folder(): | ||
cwdir = os.getcwd()+"/"+project_title+"/src" | ||
try: | ||
os.mkdir(cwdir+"/"+project_name) | ||
print(f"Directory /{project_name} created") | ||
except FileExistsError: | ||
print(f"Directory /{project_name} already exists") | ||
|
||
def create_init(): | ||
cwdir = os.getcwd()+"/"+project_title+"/src/"+project_name | ||
try: | ||
file = open(cwdir+"/__init__.py", "x") | ||
print("File __init__.py created") | ||
except FileExistsError: | ||
print("File __init__.py already exists") | ||
|
||
def create_main_file(): | ||
cwdir = os.getcwd()+"/"+project_title+"/src/"+project_name | ||
try: | ||
file = open(cwdir+"/"+project_name+".py", "x") | ||
print(f"File {project_name}.py created") | ||
except FileExistsError: | ||
print(f"File {project_name}.py already exists") | ||
|
||
create_init() | ||
create_main_file() | ||
|
||
create_subsrc_folder() | ||
|
||
def create_tests_folder(): | ||
cwdir = os.getcwd()+"/"+project_title | ||
|
||
try: | ||
os.mkdir(cwdir+"/tests") | ||
print("Directory /tests created") | ||
except FileExistsError: | ||
print("Directory /tests already exists") | ||
|
||
def create_license(): | ||
cwdir = os.getcwd()+"/"+project_title | ||
try: | ||
file = open(cwdir+"/LICENSE.txt", "x") | ||
print("File LICENSE created") | ||
except FileExistsError: | ||
print("File LICENSE already exists") | ||
|
||
def create_pyprojecttoml(): | ||
cwdir = os.getcwd()+"/"+project_title | ||
try: | ||
file = open(cwdir+"/pyproject.toml", "x") | ||
print("File pyproject.toml created") | ||
except: | ||
print("File pyproject.toml already exists") | ||
|
||
def create_readme(): | ||
cwdir = os.getcwd()+"/"+project_title | ||
try: | ||
file = open(cwdir+"/README.md", "x") | ||
print("File README.md created") | ||
except: | ||
print("File README.md already exists") | ||
|
||
create_main_folder() | ||
create_src_folder() | ||
create_tests_folder() | ||
create_license() | ||
create_pyprojecttoml() | ||
create_readme() | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
main() |