Skip to main content

bundle python files for command line tools

Project description



This application was developed for command line interface tools written by Python.



pip3 install PyBundleCli


pybundle init

This command makes ~/.pybundle/config.json.

The configuration file manages your git_account

To add your git_account

pybundle config set git_account 'YOUR_GIT_ACCOUNT'

git_account automatically set for and LICENCE. Licence is MIT LICENCE. If you need any other licence, change it.


Next, create ~/.pypirc.

This file manages pypi_account and pypi_password. Those information are used to upload our package to Originally, we must type those information whenever upload. If correct ~/.pypirc is exist, we can skip that steps.

index-servers =

username: username
password: password

username: username
password: password

Fill in your account information which you set at sign up for and

create your project

pybundle new <project-name>

Check directory struction.

❯❯❯ tree
├── hello
│   ├──
│   └──

1 directory, 5 files

Files are automatically created.

For exapmle,

❯❯❯ cat
# coding: utf-8

from setuptools import setup, find_packages
from hello import __VERSION__

def _requires_from_file(filename):
    return open(filename).read().splitlines()

with open('') as f:
    readme =

with open('LICENSE') as f:
    license_txt =

    description='Fill in your project description',
        "console_scripts": [
            "hello = hello.hello:main"
    author='Kyohei Horikawa',

As you can see, project_name, autohr, email and git_account are set.

If you needn't requirements.txt, comment out this line.

Next, install this smallest application in your local machine.

python3 sdist

dist/ is created. Compressed files are in this directory.

pip3 install dist/<version>.tar.gz

Select your own version or latest.

❯❯❯ hello
Hello, world!

Enter your own command. Hello, world! returned.

There is two points.

  • Command name depends on "console_scripts" in If you wanna change it, set new command name left side.
  • Program called when enter command is main function in <project_name>/<>. Your own scripts go on here.

Upload your comaand

Finally, upload your command to pypi or test.pypi. Important thing is to give unique name to your project. Otherwise pypi will deny your project.

First, clean up your directory.

rm -rf dist/ <project_name>.egg-info/
python3 sdist bdist_wheel
python3 -m twine upload -r testpypi dist/* --verbose

At this time, authorization is automatically done by ~/.pypirc.

Only this step, you can upload to pypi!


If you feel those steps inconvenient, you can use my useful script.

git clone

This script wrap the commands which you use install package locally and upload pypi.

Try it!!

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

PyBundleCli-0.0.13.tar.gz (6.8 kB view hashes)

Uploaded source

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