Skip to main content

Module for easy python modules creation

Project description

Pyckstart is a simple template engine for writing python modules, based on Jinja2.

It can generate bases layout for simple python modules, with or without CLI, unitests, and git local repo initialization.

It is a fork of Picnic by Zulko.

You open a console and in any folder you type

pyckstart -n ModuleName

and it will produce the following folder, with (almost ?) all the files you need. All there is left to do is write the actual code :

~: find ModuleName
 ModuleName
 ModuleName/README.rst
 ModuleName/setup.py
 ModuleName/src
 ModuleName/src/modulename
 ModuleName/src/modulename/modulename.py
 ModuleName/src/modulename/__init__.py
 ModuleName/LICENCE.txt
 ModuleName/MANIFEST.in

You can then cd to you module folder and type :

python setup.py develop

Options

Usage: pyckstart -n module_name [options]

Options:
-h, --help

show this help message and exit

-d, --debug

Enable debug output

-q, --quiet

Disable output

-v VERSION, --version=VERSION

Module version

-t, --tests

Create tests layout

-g, --git

Enable git repo creation

-c, --cli

Create CLI layout

-p PY_VERSION, --pyversion=PY_VERSION

Python version for #!/usr/bin/env python#. Default value : current python major version (2)

-n PACKAGE_NAME, --name=PACKAGE_NAME

Package name

-i, --install

Install templates in home folder

-f, --force

Will override existing files. Use with care.

Examples

To create a new module, with CLI, unitests and git, juste type :

pyckstart -t -c -g -n MyModulename

I will generate the folowing layout :

find MyModulename | grep -v git
 MyModulename
 MyModulename/README.rst
 MyModulename/setup.py
 MyModulename/src
 MyModulename/src/tests
 MyModulename/src/tests/test_mymodulename.py
 MyModulename/src/tests/__init__.py
 MyModulename/src/mymodulename
 MyModulename/src/mymodulename/mymodulename.py
 MyModulename/src/mymodulename/__init__.py
 MyModulename/src/bin
 MyModulename/src/bin/mymodulename.py
 MyModulename/src/bin/__init__.py
 MyModulename/LICENCE.txt
 MyModulename/MANIFEST.in

You can then cd to you module folder and type :

# install it in dev mode
python setup.py develop
# run unitests
python setup.py test

By installing in dev mode, your module as automagically created the CLI entrypoint. You can then, in a terminal, type :

mymodulename

Wich will run the file MyModulename/src/bin/mymodulename.py.

Installation and customization

From the source

git clone https://github.com/jcsaaddupuy/pyckstart.git

cd pyckstart

sudo python setup.py install

From pypi

Just pip install it :

pip install pyckstart --pre

Customization

If you want to pimp the templates, you can install them locall in your home foler :

pyckstart -i

All templates will be copied to ~/.pyckstart/files/, wich you can edit freely to override defaults.

Contribute

Pyckstart is an open source software originally written by Zulko and released under the MIT licence. Please help make Pyckstart or Picnic betters, for instance by expanding the capabilities, providing advice for sounder standards if you are an experienced module-maker, reporting bugs, etc. We love forks and pull resquests ! Pyckstart is being developped on Github, that’s where you should go for troubleshooting and bug reports.

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

pyckstart-0.0.3.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file pyckstart-0.0.3.tar.gz.

File metadata

  • Download URL: pyckstart-0.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyckstart-0.0.3.tar.gz
Algorithm Hash digest
SHA256 66669439e5e582b045c672a0a9260dcb610c8e08e309a92a3541f1c54b7eb178
MD5 f0cf0f8fc8c3ea8d2cd981eb3c72426b
BLAKE2b-256 17939540de0a0fba6b54e69a888c1326c3e2d4623f877fad4288554da5da837e

See more details on using hashes here.

Supported by

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