knightswhosayni


Nameknightswhosayni JSON
Version 0.2.0 PyPI version JSON
download
home_page
SummaryNi! Ni! Ni!
upload_time2023-04-09 05:03:31
maintainer
docs_urlNone
author
requires_python>=3.7
licenseApache 2.0
keywords licensing encoding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==================
Knights Who Say Ni
==================

Ni! Ni! Ni!

1. Visit software license page.

2. Give me a shrubbery i.e. pay up.

3. Receive license code.

4. Configure software with username and license code.


Quick Start
===========

.. code::

   $ pip install knightswhosayni
   $ python -m knightswhosayni.main [path/to/src] [module-name] [prefix] [license-key]
   $ tox -e py
   $ python -m build
   $ twine upload dist/*


License Users
=============


Option 1: Using Code
--------------------

.. code::

   import builtins
   builtins.[prefix]LICENSE_USER = '[username]'
   builtins.[prefix]LICENSE_CODE = '[license code]'


Option 2: Using Environment Variables
-------------------------------------

.. code::

   export [prefix]LICENSE_USER=[username]
   export [prefix]LICENSE_CODE=[license code]


Option 3: Using License File
----------------------------

.. code::

   # [prefix.lower()]license.ini
   [prefix.strip('_')]
   LICENSE_USER=[username]
   LICENSE_CODE=[license code]


Example
-------

Given:

* prefix -- `'PACKAGE_NAME_V1_'`

* username -- `name@example.com`

.. code::

   import builtins
   builtins.PACKAGE_NAME_V1_LICENSE_USER = 'name@example.com'
   builtins.PACKAGE_NAME_V1_LICENSE_CODE = 'e385cf4c-be9a-4389-82ba-bfa85b8ad17c'

.. code::

   export PACKAGE_NAME_V1_LICENSE_USER=name@example.com
   export PACKAGE_NAME_V1_LICENSE_CODE=e385cf4c-be9a-4389-82ba-bfa85b8ad17c

.. code::

   # package_name_v1_license.ini
   [PACKAGE_NAME_V1]
   LICENSE_USER=name@example.com
   LICENSE_CODE=e385cf4c-be9a-4389-82ba-bfa85b8ad17c


Caveats
=======

Maybe this package is a bad idea. But here's how I got here:

1. I occassionally make useful packages.

2. People use them and occassionally contribute (that's good!).

3. Rarely people donate to the projects (the amounts are tiny).

4. I thought about using GitHub Donors but felt like it required a whole online
   "personality". I like making friends but thought maybe old-school software
   licensing could work.

5. Real encryption using RSA or whatnot introduces a dependency that is too
   heavy (my libraries typically have no dependencies).

6. I don't want to force code to call a web server either every time it runs
   (privacy issues and whatnot).

7. I still believe most people are willing to "do the right thing" especially
   if it's more annoying to "do the wrong thing".

8. I still want to produce Open Source software so if you want to steal the
   code, it's about as easy as ctrl-c ctrl-v. BUT, I'm going to bet that losing
   the easiness of "pip install thing" is Annoying Enough(TM).

9. Hence, the Knights Who Say Ni are my paradigm. They're troublesome enough to
   bring them a shrubbery but not so troublesome that RSA encryption, and
   license servers, and lawyers need be involved.

Put into practice, the package works in four parts:

1. The `__license__.py` file is added to the Python package for distribution.

2. The `__init__.py` file of the Python package is modified for a new encoding.

3. License checks are injected into the Python package source files.

4. The Python package source files are encrypted, err, obfuscated, err,
   obscured, err, encoded with the new encoding.

Which achieves three things:

1. License checks occur on import of the source files.

2. The source files in the package are hard to change.

3. Changes to the package's `__init__.py` break the encoding.

Which I'm hoping is just Annoying Enough(TM) to motivate paying for a license
rather than working around it.

Some things this does not guard against:

1. Making your own keygen -- correct, RSA is great but too heavyweight.

2. Decoding the source code -- correct, it's already Open Source online.

3. Vendoring the unobfuscated code -- correct, but then no pip updates.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "knightswhosayni",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "licensing,encoding",
    "author": "",
    "author_email": "Grant Jenks <contact@grantjenks.com>",
    "download_url": "https://files.pythonhosted.org/packages/c3/4b/1cd28c730bae3406a48693372ce708e10f7850feca80593d683255534f89/knightswhosayni-0.2.0.tar.gz",
    "platform": null,
    "description": "==================\nKnights Who Say Ni\n==================\n\nNi! Ni! Ni!\n\n1. Visit software license page.\n\n2. Give me a shrubbery i.e. pay up.\n\n3. Receive license code.\n\n4. Configure software with username and license code.\n\n\nQuick Start\n===========\n\n.. code::\n\n   $ pip install knightswhosayni\n   $ python -m knightswhosayni.main [path/to/src] [module-name] [prefix] [license-key]\n   $ tox -e py\n   $ python -m build\n   $ twine upload dist/*\n\n\nLicense Users\n=============\n\n\nOption 1: Using Code\n--------------------\n\n.. code::\n\n   import builtins\n   builtins.[prefix]LICENSE_USER = '[username]'\n   builtins.[prefix]LICENSE_CODE = '[license code]'\n\n\nOption 2: Using Environment Variables\n-------------------------------------\n\n.. code::\n\n   export [prefix]LICENSE_USER=[username]\n   export [prefix]LICENSE_CODE=[license code]\n\n\nOption 3: Using License File\n----------------------------\n\n.. code::\n\n   # [prefix.lower()]license.ini\n   [prefix.strip('_')]\n   LICENSE_USER=[username]\n   LICENSE_CODE=[license code]\n\n\nExample\n-------\n\nGiven:\n\n* prefix -- `'PACKAGE_NAME_V1_'`\n\n* username -- `name@example.com`\n\n.. code::\n\n   import builtins\n   builtins.PACKAGE_NAME_V1_LICENSE_USER = 'name@example.com'\n   builtins.PACKAGE_NAME_V1_LICENSE_CODE = 'e385cf4c-be9a-4389-82ba-bfa85b8ad17c'\n\n.. code::\n\n   export PACKAGE_NAME_V1_LICENSE_USER=name@example.com\n   export PACKAGE_NAME_V1_LICENSE_CODE=e385cf4c-be9a-4389-82ba-bfa85b8ad17c\n\n.. code::\n\n   # package_name_v1_license.ini\n   [PACKAGE_NAME_V1]\n   LICENSE_USER=name@example.com\n   LICENSE_CODE=e385cf4c-be9a-4389-82ba-bfa85b8ad17c\n\n\nCaveats\n=======\n\nMaybe this package is a bad idea. But here's how I got here:\n\n1. I occassionally make useful packages.\n\n2. People use them and occassionally contribute (that's good!).\n\n3. Rarely people donate to the projects (the amounts are tiny).\n\n4. I thought about using GitHub Donors but felt like it required a whole online\n   \"personality\". I like making friends but thought maybe old-school software\n   licensing could work.\n\n5. Real encryption using RSA or whatnot introduces a dependency that is too\n   heavy (my libraries typically have no dependencies).\n\n6. I don't want to force code to call a web server either every time it runs\n   (privacy issues and whatnot).\n\n7. I still believe most people are willing to \"do the right thing\" especially\n   if it's more annoying to \"do the wrong thing\".\n\n8. I still want to produce Open Source software so if you want to steal the\n   code, it's about as easy as ctrl-c ctrl-v. BUT, I'm going to bet that losing\n   the easiness of \"pip install thing\" is Annoying Enough(TM).\n\n9. Hence, the Knights Who Say Ni are my paradigm. They're troublesome enough to\n   bring them a shrubbery but not so troublesome that RSA encryption, and\n   license servers, and lawyers need be involved.\n\nPut into practice, the package works in four parts:\n\n1. The `__license__.py` file is added to the Python package for distribution.\n\n2. The `__init__.py` file of the Python package is modified for a new encoding.\n\n3. License checks are injected into the Python package source files.\n\n4. The Python package source files are encrypted, err, obfuscated, err,\n   obscured, err, encoded with the new encoding.\n\nWhich achieves three things:\n\n1. License checks occur on import of the source files.\n\n2. The source files in the package are hard to change.\n\n3. Changes to the package's `__init__.py` break the encoding.\n\nWhich I'm hoping is just Annoying Enough(TM) to motivate paying for a license\nrather than working around it.\n\nSome things this does not guard against:\n\n1. Making your own keygen -- correct, RSA is great but too heavyweight.\n\n2. Decoding the source code -- correct, it's already Open Source online.\n\n3. Vendoring the unobfuscated code -- correct, but then no pip updates.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Ni! Ni! Ni!",
    "version": "0.2.0",
    "split_keywords": [
        "licensing",
        "encoding"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e48edb0481e782c3e8bf60ac1c7e641a6532b4e5647cfbd2d97d1d798881056f",
                "md5": "30de5d5f9e02e810c88ed9cabe99bc8b",
                "sha256": "48e01a6cd95db98e68398df2a81d0d4332b1dd284ecc2c185cb8439168d4dec8"
            },
            "downloads": -1,
            "filename": "knightswhosayni-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30de5d5f9e02e810c88ed9cabe99bc8b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 14911,
            "upload_time": "2023-04-09T05:03:29",
            "upload_time_iso_8601": "2023-04-09T05:03:29.605435Z",
            "url": "https://files.pythonhosted.org/packages/e4/8e/db0481e782c3e8bf60ac1c7e641a6532b4e5647cfbd2d97d1d798881056f/knightswhosayni-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c34b1cd28c730bae3406a48693372ce708e10f7850feca80593d683255534f89",
                "md5": "70cf1e9e0d733311071ce22853ae3321",
                "sha256": "62380fbd7f162f745ef86dca342ae528009bcca9b6d2d3ad59dbc92da15cf4b1"
            },
            "downloads": -1,
            "filename": "knightswhosayni-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "70cf1e9e0d733311071ce22853ae3321",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11826,
            "upload_time": "2023-04-09T05:03:31",
            "upload_time_iso_8601": "2023-04-09T05:03:31.175337Z",
            "url": "https://files.pythonhosted.org/packages/c3/4b/1cd28c730bae3406a48693372ce708e10f7850feca80593d683255534f89/knightswhosayni-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-09 05:03:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "knightswhosayni"
}
        
Elapsed time: 0.35038s