Skip to main content

A simple pyproject.toml initiator

Project description

tomifier

pyproject.toml is a modern way to create a python package. tomifier is CLI to initialize a simple Python pyproject.toml file and starting code. The starting code is itself a CLI that can launch a web application.

References: pyproject.toml vs setup.py

Installation

pip install tomifier

Usage

Initialize on current Folder:

  • tomifier init

Initialize on target folder:

  • tomifier init --output target_folder/

Initialize on with a project name and a target folder:

  • tomifier init --name myproject1 --output target_folder/

Files created

The CLI will create the following files and folder structure locally or at the target folder:

<package_name>/__init__.py
<package_name>/version.py
<package_name>/cmd/__init__.py
<package_name>/cmd/root.py
<package_name>/cmd/static/index.html
LICENSE
README
pyproject.toml
MANIFEST.in
setup.py
buid.sh

Sample Output from running the tool

 tomifier init --output myproj1
tomifier CLI
Package name [mypackage]: myproject1
Description [My package]: Description for myproject1
Author [Name]: 
Author email [name@email.com]: 
Homepage [https://github/usernane/repo]: 
Comma separated packages (space=None) [click, fastapi, unvicorn[standard]]: 
Creating package myproject1 in folder myproj1 with author Name and email name@email.com
Creating folder myproj1
New project iniatialize at: myproj1

Sample generated pyproject.toml file

[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "myproject1"
authors = [
  { name="Name", email="name@email.com" },
]
description = "Description for myproject1"
readme = "README.md"
license = { file="LICENSE" }
requires-python = ">=3.10, <3.12"
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
]

dependencies = [
  "click",
  "fastapi",
  "unvicorn[standard]"
]

dynamic = ["version"]

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = {attr = "myproject1.version.VERSION"}
readme = {file = ["README.md"]}

[tool.setuptools.packages.find]
include = ["myproject1*"]
exclude = ["*.tests*"]
namespaces = false

[tool.setuptools.package-data]
"myproject1" = ["*.*"]

[project.urls]
"Homepage" = "https://github/usernane/repo"

[project.scripts]
myproject1 = "myproject1.cmd.root:main"

build.sh

build.sh is a useful bash script to start the build process and deploy the package locally in editable mode.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tomifier-0.0.1a0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

tomifier-0.0.1a0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file tomifier-0.0.1a0.tar.gz.

File metadata

  • Download URL: tomifier-0.0.1a0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for tomifier-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 b79e1c7b0d75d1462cefabb823c06f114c345ff09f5b6aab90906d429ee2c963
MD5 d545b9b3fdb67ea7fb2214a12e21f479
BLAKE2b-256 b0726666ff9db102c82ca73616ff8f517665cdcce685e8218e1f303f56328e59

See more details on using hashes here.

File details

Details for the file tomifier-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: tomifier-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for tomifier-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e583b418d5fd201553fadc801b36f9064aca26ff92eac778107c57693d9ff51
MD5 406de8ad5b358585e417b123882ef10b
BLAKE2b-256 4c2240f1e37f2e2829b7627073b2a4e2a300debee0e315571768fff29b5ce9c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page