cement


Namecement JSON
Version 3.0.10 PyPI version JSON
download
home_pagehttps://builtoncement.com
SummaryApplication Framework for Python
upload_time2024-02-29 04:21:17
maintainer
docs_urlNone
authorData Folk Labs, LLC
requires_python>=3.8
licenseBSD
keywords cli framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            # Cement Framework

[![Built on Cementâ„¢](https://img.shields.io/badge/Built%20on%20Cement%E2%84%A2-3.0-yellow)](https://builtoncement.com)
[![PyPi Downloads](https://img.shields.io/pypi/dm/cement)](https://pypistats.org/packages/cement)
[![Continuous Integration Status](https://app.travis-ci.com/datafolklabs/cement.svg?branch=master)](https://app.travis-ci.com/github/datafolklabs/cement/)


Cement is an advanced Application Framework for Python, with a primary focus on Command Line Interfaces (CLI).  Its goal is to introduce a standard, and feature-full platform for both simple and complex command line applications as well as support rapid development needs without sacrificing quality.  Cement is flexible, and it's use cases span from the simplicity of a micro-framework to the complexity of a mega-framework. Whether it's a single file script, or a multi-tier application, Cement is the foundation you've been looking for.

The first commit to Git was on Dec 4, 2009.  Since then, the framework has seen several iterations in design, and has continued to grow and improve since it's inception.  Cement is the most stable, and complete framework for command line and backend application development.

## Core Features

Cement core features include (but are not limited to):

- Core pieces of the framework are customizable via handlers/interfaces
- Handler system connects implementation classes with Interfaces
- Extension handler interface to easily extend framework functionality
- Config handler supports parsing multiple config files into one config
- Argument handler parses command line arguments and merges with config
- Log handler supports console and file logging
- Plugin handler provides an interface to easily extend your application
- Output handler interface renders return dictionaries to console
- Cache handler interface adds caching support for improved performance
- Controller handler supports sub-commands, and nested controllers
- Hook support adds a bit of magic to apps and also ties into framework
- Zero external dependencies* (not including optional extensions)
- 100% test coverage (`pytest`)
- 100% PEP8 compliant (`flake8`)
- Extensive API Reference (`sphinx`)
- Tested on Python 3.8+

*Some optional extensions that are shipped with the mainline Cement sources do require external dependencies.  It is the responsibility of the application developer to include these dependencies along with their application, as Cement explicitly does not include them.*


## More Information

- [Official Website / Developer Documentation](http://builtoncement.com/)
- [PyPi Packages](http://pypi.python.org/pypi/cement/)
- [Github Source Code / Issue Tracking](http://github.com/datafolklabs/cement/)
- [Travis CI](https://travis-ci.org/datafolklabs/cement/)
- [Slack Channel](https://join.slack.com/t/cementframework/shared_invite/enQtMzU0OTc5MDQ4NDA0LWMwMzZiOTczZjM4ZjFiZDE3MDk4MzA5ZmYxNmZjNTk4NzUwMzcyN2VlMDc5NzIxYjQ1NzlmNzgyNDFjMWJmMWY)


## License

The Cement CLI Application Framework is Open Source and is distributed under the BSD License (three clause).  Please see the LICENSE file included with this software.

## Development

### Docker

This project includes a `docker-compose` configuration that sets up all required services, and dependencies for development and testing.  This is the recommended path for local development, and is the only fully supported option.

The following creates all required docker containers, and launches an BASH shell within the `cement` dev container for development.
```
$ make dev

|> cement <| src #
```

The above is the equivalent of running:

```
$ docker-compose up -d

$ docker-compose exec cement /bin/bash
```

**Testing Alternative Versions of Python**

The latest stable version of Python 3 is the default, and target version accessible as the `cement` container within Docker Compose.  For testing against alternative versions of python, additional containers are created (ex: `cement-py38`, `cement-py39`, etc). You can access these containers via:

```
$ docker-compose ps
        Name                      Command               State     Ports
-------------------------------------------------------------------------
cement_cement-py38_1   /bin/bash                        Up
cement_cement-py39_1   /bin/bash                        Up
cement_cement-py310_1   /bin/bash                        Up
cement_cement-py311_1   /bin/bash                        Up
cement_cement_1        /bin/bash                        Up
cement_memcached_1     docker-entrypoint.sh memcached   Up      11211/tcp
cement_redis_1         docker-entrypoint.sh redis ...   Up      6379/tcp


$ docker-compose exec cement-py39 /bin/bash

|> cement-py39 <| src #
```


### VirtualENV

An traditional VirtualENV helper is available:

```
$ make virtualenv

$ source env/bin/activate

|> cement <| $
```

### Vagrant

An alternative option is included to run Vagrant for development.  This is partially supported, primarily for the purpose of developing/testing on Windows as well as testing specific issues on target operating systems.

To see a list of configured systems:

```
$ vagrant status
```

#### Linux

```
$ vagrant up linux

$ vagrant ssh linux

vagrant@linux $ cd /vagrant

vagrant@linux $ bash scripts/vagrant/bootstrap.sh

vagrant@linux $ make virtualenv

vagrant@linux $ source env/bin/activate

|> cement >| $
```

#### Windows

*Windows development and support is not 100% complete.  Cement is known to run and work on Windows, however it is not a primary target for development and as such the setup is not as streamlined and currently has several known errors.*

The following assumes you're running these two initial commands from a unix based system:

```
$ make clean

$ vagrant up windows
```

RDP or Login to Desktop/Console, and open a PowerShell terminal:

```
C:\> cd C:\Vagrant

C:\Vagrant> powershell.exe scripts\vagrant\bootstrap.ps1

C:\Vagrant> make virtualenv-windows

C:\Vagrant> .\env-windows\Scripts\activate.ps1

C:\Vagrant> make test-core
```

*Note that only the core library is fully tested on Windows.*


### Running Tests and Compliance

Cement has a strict policy that all code and tests meet PEP8 guidelines, therefore `flake8` is called before any unit tests run.  All code submissions require 100% test coverage and PEP8 compliance:

Execute the following to run all compliance and unit tests:

```
$ make test
```

A coverage report is printed to console, as well as the HTML version created in `coverage-report`:

```
$ open coverage-report/index.html
```

See `Makefile` for all other common development actions.

            

Raw data

            {
    "_id": null,
    "home_page": "https://builtoncement.com",
    "name": "cement",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "cli framework",
    "author": "Data Folk Labs, LLC",
    "author_email": "derks@datafolklabs.com",
    "download_url": "https://files.pythonhosted.org/packages/ba/bf/345b067977ade8b3b1b10d8394888bbaa45f4d7a6437fbd48b87c69e800f/cement-3.0.10.tar.gz",
    "platform": null,
    "description": "# Cement Framework\n\n[![Built on Cement\u2122](https://img.shields.io/badge/Built%20on%20Cement%E2%84%A2-3.0-yellow)](https://builtoncement.com)\n[![PyPi Downloads](https://img.shields.io/pypi/dm/cement)](https://pypistats.org/packages/cement)\n[![Continuous Integration Status](https://app.travis-ci.com/datafolklabs/cement.svg?branch=master)](https://app.travis-ci.com/github/datafolklabs/cement/)\n\n\nCement is an advanced Application Framework for Python, with a primary focus on Command Line Interfaces (CLI).  Its goal is to introduce a standard, and feature-full platform for both simple and complex command line applications as well as support rapid development needs without sacrificing quality.  Cement is flexible, and it's use cases span from the simplicity of a micro-framework to the complexity of a mega-framework. Whether it's a single file script, or a multi-tier application, Cement is the foundation you've been looking for.\n\nThe first commit to Git was on Dec 4, 2009.  Since then, the framework has seen several iterations in design, and has continued to grow and improve since it's inception.  Cement is the most stable, and complete framework for command line and backend application development.\n\n## Core Features\n\nCement core features include (but are not limited to):\n\n- Core pieces of the framework are customizable via handlers/interfaces\n- Handler system connects implementation classes with Interfaces\n- Extension handler interface to easily extend framework functionality\n- Config handler supports parsing multiple config files into one config\n- Argument handler parses command line arguments and merges with config\n- Log handler supports console and file logging\n- Plugin handler provides an interface to easily extend your application\n- Output handler interface renders return dictionaries to console\n- Cache handler interface adds caching support for improved performance\n- Controller handler supports sub-commands, and nested controllers\n- Hook support adds a bit of magic to apps and also ties into framework\n- Zero external dependencies* (not including optional extensions)\n- 100% test coverage (`pytest`)\n- 100% PEP8 compliant (`flake8`)\n- Extensive API Reference (`sphinx`)\n- Tested on Python 3.8+\n\n*Some optional extensions that are shipped with the mainline Cement sources do require external dependencies.  It is the responsibility of the application developer to include these dependencies along with their application, as Cement explicitly does not include them.*\n\n\n## More Information\n\n- [Official Website / Developer Documentation](http://builtoncement.com/)\n- [PyPi Packages](http://pypi.python.org/pypi/cement/)\n- [Github Source Code / Issue Tracking](http://github.com/datafolklabs/cement/)\n- [Travis CI](https://travis-ci.org/datafolklabs/cement/)\n- [Slack Channel](https://join.slack.com/t/cementframework/shared_invite/enQtMzU0OTc5MDQ4NDA0LWMwMzZiOTczZjM4ZjFiZDE3MDk4MzA5ZmYxNmZjNTk4NzUwMzcyN2VlMDc5NzIxYjQ1NzlmNzgyNDFjMWJmMWY)\n\n\n## License\n\nThe Cement CLI Application Framework is Open Source and is distributed under the BSD License (three clause).  Please see the LICENSE file included with this software.\n\n## Development\n\n### Docker\n\nThis project includes a `docker-compose` configuration that sets up all required services, and dependencies for development and testing.  This is the recommended path for local development, and is the only fully supported option.\n\nThe following creates all required docker containers, and launches an BASH shell within the `cement` dev container for development.\n```\n$ make dev\n\n|> cement <| src #\n```\n\nThe above is the equivalent of running:\n\n```\n$ docker-compose up -d\n\n$ docker-compose exec cement /bin/bash\n```\n\n**Testing Alternative Versions of Python**\n\nThe latest stable version of Python 3 is the default, and target version accessible as the `cement` container within Docker Compose.  For testing against alternative versions of python, additional containers are created (ex: `cement-py38`, `cement-py39`, etc). You can access these containers via:\n\n```\n$ docker-compose ps\n        Name                      Command               State     Ports\n-------------------------------------------------------------------------\ncement_cement-py38_1   /bin/bash                        Up\ncement_cement-py39_1   /bin/bash                        Up\ncement_cement-py310_1   /bin/bash                        Up\ncement_cement-py311_1   /bin/bash                        Up\ncement_cement_1        /bin/bash                        Up\ncement_memcached_1     docker-entrypoint.sh memcached   Up      11211/tcp\ncement_redis_1         docker-entrypoint.sh redis ...   Up      6379/tcp\n\n\n$ docker-compose exec cement-py39 /bin/bash\n\n|> cement-py39 <| src #\n```\n\n\n### VirtualENV\n\nAn traditional VirtualENV helper is available:\n\n```\n$ make virtualenv\n\n$ source env/bin/activate\n\n|> cement <| $\n```\n\n### Vagrant\n\nAn alternative option is included to run Vagrant for development.  This is partially supported, primarily for the purpose of developing/testing on Windows as well as testing specific issues on target operating systems.\n\nTo see a list of configured systems:\n\n```\n$ vagrant status\n```\n\n#### Linux\n\n```\n$ vagrant up linux\n\n$ vagrant ssh linux\n\nvagrant@linux $ cd /vagrant\n\nvagrant@linux $ bash scripts/vagrant/bootstrap.sh\n\nvagrant@linux $ make virtualenv\n\nvagrant@linux $ source env/bin/activate\n\n|> cement >| $\n```\n\n#### Windows\n\n*Windows development and support is not 100% complete.  Cement is known to run and work on Windows, however it is not a primary target for development and as such the setup is not as streamlined and currently has several known errors.*\n\nThe following assumes you're running these two initial commands from a unix based system:\n\n```\n$ make clean\n\n$ vagrant up windows\n```\n\nRDP or Login to Desktop/Console, and open a PowerShell terminal:\n\n```\nC:\\> cd C:\\Vagrant\n\nC:\\Vagrant> powershell.exe scripts\\vagrant\\bootstrap.ps1\n\nC:\\Vagrant> make virtualenv-windows\n\nC:\\Vagrant> .\\env-windows\\Scripts\\activate.ps1\n\nC:\\Vagrant> make test-core\n```\n\n*Note that only the core library is fully tested on Windows.*\n\n\n### Running Tests and Compliance\n\nCement has a strict policy that all code and tests meet PEP8 guidelines, therefore `flake8` is called before any unit tests run.  All code submissions require 100% test coverage and PEP8 compliance:\n\nExecute the following to run all compliance and unit tests:\n\n```\n$ make test\n```\n\nA coverage report is printed to console, as well as the HTML version created in `coverage-report`:\n\n```\n$ open coverage-report/index.html\n```\n\nSee `Makefile` for all other common development actions.\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Application Framework for Python",
    "version": "3.0.10",
    "project_urls": {
        "Documentation": "https://docs.builtoncement.com",
        "Homepage": "https://builtoncement.com",
        "Source": "https://github.com/datafolklabs/cement"
    },
    "split_keywords": [
        "cli",
        "framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "428623fbd8617a90262d09a7e5db9cd923d6dc80d9f000faa51af129b5184fa1",
                "md5": "e6087fc111b0c22fab67b16192da17dd",
                "sha256": "8b70a26f0cfe53f1c90e972de27e2e78d180d13e386d11022dc8e65035b11f1e"
            },
            "downloads": -1,
            "filename": "cement-3.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6087fc111b0c22fab67b16192da17dd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 334747,
            "upload_time": "2024-02-29T04:21:16",
            "upload_time_iso_8601": "2024-02-29T04:21:16.420204Z",
            "url": "https://files.pythonhosted.org/packages/42/86/23fbd8617a90262d09a7e5db9cd923d6dc80d9f000faa51af129b5184fa1/cement-3.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "babf345b067977ade8b3b1b10d8394888bbaa45f4d7a6437fbd48b87c69e800f",
                "md5": "26b81fc5c2c5f3c40d7fd093b2fbea58",
                "sha256": "73d1015ebf9b8df13e6bc987edf0d4be3f1c8b4438921eea8d66cbb5504aee15"
            },
            "downloads": -1,
            "filename": "cement-3.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "26b81fc5c2c5f3c40d7fd093b2fbea58",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 466401,
            "upload_time": "2024-02-29T04:21:17",
            "upload_time_iso_8601": "2024-02-29T04:21:17.973902Z",
            "url": "https://files.pythonhosted.org/packages/ba/bf/345b067977ade8b3b1b10d8394888bbaa45f4d7a6437fbd48b87c69e800f/cement-3.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-29 04:21:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "datafolklabs",
    "github_project": "cement",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": false,
    "requirements": [],
    "lcname": "cement"
}
        
Elapsed time: 1.11840s