Skip to main content

Create, version and upload library

Project description

libtool

libtool is a Python library for creating a Python library, and also manages versions and uploading to PyPi with twine

libtool runs in Python 3+ and only in Windows.

Instructions

You need to make a use_file.ini like this(see more options below):

[info]
# example with if...main that uses all imports from your library
test_file:test.py
# can also be test_file=your_test_file.py
author:test author
email=test.author@mail.com
description = description of the library
url=http://test.author.com
#dependencies
install_requires=mhyt,mhmovie
license:mit

and your test.py (Same as test_file above) like this:

from my_test_library.file1 import plus
from my_test_library.file2 import minus
#
if __name__ == "__main__":
    plus(2,2)#4
    # ##############
    minus(11,1)#10

To create library from ini:

libtool c {your ini file}
#or
libtool create {your ini file}

And the libtool creates the following files automatically:

  • setup.py
  • __ init __.py
  • License.txt
  • README.md

and the libtool will ask you if you want to edit readme.

To change version number(run version from the folder with setup.py):

libtool v

and the libtool ask "enter new version:".

To upload (Run upload from the folder with setup.py):

libtool upload
#or
libtool u
#you can add twine options e.g.
libtool u -r testpypi

Twine options here

Access from python

To access the libtool from a python file:

from libtool._cmd_argv import cmd
cmd.parse(["c", "use_file.ini"])
# or 
cmd.parse( ["u", "-r testpypi"])
#and all commands

Prerequisites

libtool depends on the python modules:

Markdown-Editor, requests, setuptools, wheel and twine

Installing

To install with pip- type in terminal:

(sudo) pip install libtool

if this doesn't work try:

pip install --upgrade setuptools wheel

if there is still an error please open an issue in github issues.

Additional options

To show help message:

libtool ?
#or
libtool help

Additional options for ini file (also in "info" section):

#foldername with your library in it, then not all imports need
#to be in file
folder=foldername 
#can also be folder:foldername
#the version of the library
start_version:1.0.0
#cmd scripts or other files that you want in path, like in setuptools scripts.
#separate scripts with commas.
scripts:script1.cmd,script2.exe

Additional options for create library command:

# to disable open editor to edit readme.md:
libtool c {your ini file} -e edit
# to disable create readme.md:
libtool c {your ini file} -e readme 
# to disable create setup.py:
libtool c {your ini file} -e setup
# to disable create __init__.py:
libtool c {your ini file} -e init
# to disable create licence.txt:
libtool c {your ini file} -e licence
# you can merge options
libtool c use_file.ini -e edit readme setup init licence

View examples here

Custom options

You can also set custom options using Python. To create a library:

from libtool.libtool_class import Library

l = Library(
    test_file="test.py",
    email="your.email@your_mail.com",
    description="only for test",
    url = "http://your.url.com",
    pylicense="mit",
    author="author",
    install_requires=["mhyt","mhmovie"],
    #and the additional options:
    folder="foldername",
    start_version="2.7.3",
    scripts=["script1.bat",]
)
#to create __init__.py
l.c_init()
#to create licence.txt
l.c_licence()
#to create setup.py
l.c_setup()
#to create readme.md
l.c_md()
#to edit readme.md
l.edit_md()

To change version:

from libtool.up_version import UpVersion

UpVersion("my-sample-library")

To publish to PyPi:

from libtool.pypi.up_pypi import up
up("my-sample-library")
#you can add twine options e.g.
up("my-sample-library","-r testpypi")

Built With

Author

matan h

License

This project is licensed under the MIT License.

Created by

This library was created using libtool

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

libtool-0.1.3.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

libtool-0.1.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file libtool-0.1.3.tar.gz.

File metadata

  • Download URL: libtool-0.1.3.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for libtool-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7f581c2d5991561e0fb2e73f25e79844ef4e18759f05652ab1cf1249b16ce093
MD5 2c16faf0ecb845050507a67262b38aca
BLAKE2b-256 652b581dcc058bba2ac27292accf3bec96d87f0986ca52bd50f76fd47a357c56

See more details on using hashes here.

File details

Details for the file libtool-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: libtool-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for libtool-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f24b4d09de91b2ed6186bf0d0c16d2447ee80a1f2b836387ebff124320fd8c2
MD5 20bb054e39072ade2bd2116db775974a
BLAKE2b-256 43282adb4e341238d07df34db189d6430a4d595e8c044979c5805399a85f28b4

See more details on using hashes here.

Supported by

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