Skip to main content

perfect-pypi - Empty example PYPI package by leecampbellc85

Project description

Empty example PYPI package by leecampbellc85 ############################################

Change log ###########

  • version 0.0.1.12
    • Basic unittest for Core module
    • Documentation
  • version 0.0.1.6
    • Execute this from command-line (pfpy -v)
  • version 0.0.0.1
    • Init files and directory structure

Requirements #############

  • Linux OS or Windows OS
  • Python (2.7)

Basic install #############

.. code-block::

pip install perfect-pypi --upgrade

(install without cache: pip install perfect-pypi --no-cache-dir )

You can find the detailed documentation in https://github.com/leecampbellc85/perfect-pypi.

Usage

From command line


  • Usage:
    • pfpy --version
    • pfpy core --input TEXT
    • pfpy core -i TEXT -o string
    • pfpy core -i TEXT --output json
  • Arguments:
  • Options:
    • -h --help show this help message and exit
    • -v --version show version and exit
    • --verbose print status messages
    • -i --input set input and exit
    • -o --output output format default is string. Possible values: string, json

You merely type the pfpy command to commandline with the required parameters.

  • pfpy --version or pfpy -v : Get version of our package
  • *pfpy core --input TEXT * or pfpy core -i TEXT -o string : Write out to screen the TEXT in string format. (module: core)
  • pfpy core -i TEXT --output json : Write out to screen the TEXT in json format. (module: core)

From Python


Import the required module from perfectpypi package in python

.. code-block::

import perfectpypi

Examples ########

From command line


  1. Get version: """""""""""""""""""""

.. code-block::

pfpy -v

Result: .. code-block::

0.0.1.11
  1. Write out text in string format: """"""""""""""""""""""""""""""""""""""""

.. code-block::

pfpy core -i "Hello World"

Result:

.. code-block::

Hello World
  1. Write out text in json format: """""""""""""""""""""""""""""""""""""""""

.. code-block::

pfpy core -i "Hello World" -o json

Result:

.. code-block::

[{'text': 'Hello World'}]

From Python


Every example assumes you are in python shell

  1. Execute core module related unittest """"""""""""""""""""""""""""""""""""""""""""""""""

.. code-block::

from perfectpypi.core.perfectpypi_core_unittest import *
testResult = runUnittests()

Result:

.. code-block::

test_input (perfectpypi.core.perfectpypi_core_unittest.TestCoreModule) ... All tests passed so far!
ok
test_output (perfectpypi.core.perfectpypi_core_unittest.TestCoreModule) ... All tests passed so far!
ok

----------------------------------------------------------------------
Ran 2 tests in 0.003s

OK
  1. Write out text in string format: """"""""""""""""""""""""""""""""""""""""""""""""""

.. code-block::

from perfectpypi.core.perfectpypi_core import *
getText("Hello World")

Result:

.. code-block::

Hello World
  1. Write out text in json format: """"""""""""""""""""""""""""""""""""""""""""""""""

.. code-block::

from perfectpypi.core.perfectpypi_core import *
getText("Hello World", "json")

Result:

.. code-block::

{'text': 'Hello World'}

Known issues #############

Permission denied on /usr/bin/pfpy


Sometimes you are facing the following issue when you execute the pfpy command:

.. code-block::

-bash: /usr/bin/pfpy: Permission denied

Solution to execute the following command:

.. code-block::

sudo chmod +x /usr/bin/pfpy

Command not found on /usr/bin/pfpy


Although the package is well prepared sometimes you are facing the following issue after a package update when you execute the pfpy command:

.. code-block::

/usr/bin/pfpy: line 2: $'\r': command not found
/usr/bin/pfpy: line 19: syntax error: unexpected end of file

Solution to execute the following command:

.. code-block::

sudo dos2unix /usr/bin/pfpy

LICENSE (MIT) #############

Copyright (c) 2019

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.

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

perfect-pypi-0.0.1.12.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perfect_pypi-0.0.1.12-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file perfect-pypi-0.0.1.12.tar.gz.

File metadata

  • Download URL: perfect-pypi-0.0.1.12.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for perfect-pypi-0.0.1.12.tar.gz
Algorithm Hash digest
SHA256 920f84bde5d4f963d5c5a13a2d738238882a1921aa93f82c69d4ec6860d4eeed
MD5 ac6fb263a021c36f12e7494f9afb8502
BLAKE2b-256 b31ab882509319a6551a3a3c08c4cbcbe555382c471740aba7a707b3491d6e69

See more details on using hashes here.

File details

Details for the file perfect_pypi-0.0.1.12-py2.py3-none-any.whl.

File metadata

  • Download URL: perfect_pypi-0.0.1.12-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for perfect_pypi-0.0.1.12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f8d4509fc08e656ec3514f2ce7a945f08d88f7a0de55f08842fc8dff6453a8e1
MD5 669dea67476686835c23810292ca8539
BLAKE2b-256 475517e8a66e8ff989ae12c728bba8fb519de11c97786a5aa077c74a41fc1c3e

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