socon


Namesocon JSON
Version 0.2 PyPI version JSON
download
home_page
SummaryA high-level Python framework that enables you to develop a generic, robust and reliable framework for your different projects.
upload_time2023-08-10 19:48:28
maintainer
docs_urlNone
author
requires_python>=3.9
licenseBSD-3-Clause
keywords projects socon scripts commands
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            =====
Socon
=====

.. image:: https://img.shields.io/badge/python-3.9-blue.svg
    :target: https://github.com/socon-dev/socon

.. image:: https://github.com/socon-dev/socon/actions/workflows/tests.yml/badge.svg
    :target: https://github.com/socon-dev/socon/actions?query=workflow%3APython%20testing

.. image:: https://codecov.io/gh/socon-dev/socon/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/socon-dev/socon
    :alt: Code coverage Status

.. image:: https://github.com/socon-dev/socon/actions/workflows/linters.yml/badge.svg
    :target: https://github.com/socon-dev/socon/actions?query=workflow%3APython%20linting

.. image:: https://readthedocs.org/projects/socon/badge/?version=latest
    :target: https://socon.readthedocs.io/en/latest/
    :alt: Documentation Status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black


Socon is a high-level Python framework that helps you develop a generic and
robust framework for your different projects. Let us forget about
writing hundred of scripts with thousands of configurations, this framework
will help your organize your work and will speed your development.

Socon's create a generic Django like project structure. It's a structure that contains
all the element for you to get started with your framework and all
your different projects.

Why Socon ?
===========

I believe we have all ended-up in a situation where we have had multiple
projects that need to share the same scripts or components. Some projects may need a
specific configuration or a specific function to be executed. Also, we often
spend a great amount of time writing a script that is not generic enough to be used by
all of our different projects.

Socon has been designed to simplify all that. Socon works with commands.
Socon will let you define common commands that can be shared across projects.
Each project can either write their own commands, or override common commands
to change their behaviors by adding or removing functionalities.

The framework also provide features like managers and hooks. These features will
allow you to increase the functionalities of your framework while maintaining
genericity across your different projects.

Documentation
=============

The full documentation is in the "``docs``" directory on `GitHub`_ or online at
https://socon.readthedocs.io/en/latest/

If you are just getting started, We recommend that you read the documentation in this
order:

* Read ``docs/intro/install.txt`` for instructions on how to install Socon.

* Walk through each tutorial in numerical order: ``docs/intro/tutorials``

* Jump to the ``docs/how-to`` for specific problems and use-cases.

* Checkout the ``docs/ref`` for more details about API's and functionalities.

Check ``docs/README`` for instructions on building an HTML version of the docs.

Example
=======

Let's imagine that you have two different projects. One project called ``artemis``
and the other one ``apollo``. Both of these NASA projects need to launch a different
rocket.

There are two possibilities:

* Write a different scripts for each project but you lose the genericity.

* Or write a generic script that will load a configuration file with
  the information of both rockets and the launch procedure.
  This will be the best solution, but it will be time consuming
  and might not take into account all the possibilities.

Socon was created to facilitate the second method. You are able to create common
commands that are available to all projects you have created
using the ``createproject`` command.

.. code-block:: python

    from socon.core.management.base import ProjectCommand, Config
    from socon.core.registry.base import ProjectConfig


    class LaunchCommand(ProjectCommand):
        name = 'launch'

        def handle(self, config: Config, project_config: ProjectConfig):
            spacecraft = project_config.get_setting('SPACECRAFT')
            print(f'Launching the {spacecraft} SpaceCraft to the moon')

This command is declared in the common space of your framework created by the
``createcontainer`` command.

We are using a project_config object to load the name of the spacecraft.
This project_config object is loaded when you start the command and you specify the
project.

The ``SPACECRAFT`` variable is stored in a file called ``config.py`` at the root of
every project created by the command ``createproject``.

.. code-block:: python

    # Artemis config.py
    SPACECRAFT = 'Artemis 1'

.. code-block:: python

    # Apollo config.py
    SPACECRAFT = 'Saturn V'

Now that everything is setup. You can just run the following:

.. code-block:: console

    $ python manage.py launch --project artemis
    $ Launching the Artemis 1 SpaceCraft the the moon

    $ python manage.py launch --project apollo
    $ Launching the Saturn V SpaceCraft the the moon

Of course the framework capabilities do not stop here. You can go even further,
for example by redefining functionalities of the launch command.

We invite you to walk through each tutorial in numerical
order here: ``docs/intro/tutorials``


Contribution
============

Anyone can contribute to Socon's development. Checkout our documentation
on how to get involved: `https://socon.readthedocs.io/en/latest/internals/contributing.html`

This is a one man show for now, send help!

License
=======

Copyright Stephane Capponi and others, 2023
Distributed under the terms of the BSD-3-Clause license, Socon is free and
open source software.

Socon also reused codes from third-party. You can find the licenses of these
third-party in the `licenses`_ folder. Each files that has been reused and
modified contains an SPDX section to specify the license used and the Copyright.
If you want more information about our license and why we reused code
from third-party, check the ``docs/intro/overview.txt``

.. _licenses: https://github.com/socon-dev/socon/tree/master/licenses
.. _GitHub: https://github.com/socon-dev/socon/

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "socon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "projects,socon,scripts,commands",
    "author": "",
    "author_email": "Stephane Capponi <stephane.capponi@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/26/51/6864333f8363243e4660810c58b81034ce56ea6272f75baee8816c6fe80e/socon-0.2.tar.gz",
    "platform": null,
    "description": "=====\r\nSocon\r\n=====\r\n\r\n.. image:: https://img.shields.io/badge/python-3.9-blue.svg\r\n    :target: https://github.com/socon-dev/socon\r\n\r\n.. image:: https://github.com/socon-dev/socon/actions/workflows/tests.yml/badge.svg\r\n    :target: https://github.com/socon-dev/socon/actions?query=workflow%3APython%20testing\r\n\r\n.. image:: https://codecov.io/gh/socon-dev/socon/branch/master/graph/badge.svg\r\n    :target: https://codecov.io/gh/socon-dev/socon\r\n    :alt: Code coverage Status\r\n\r\n.. image:: https://github.com/socon-dev/socon/actions/workflows/linters.yml/badge.svg\r\n    :target: https://github.com/socon-dev/socon/actions?query=workflow%3APython%20linting\r\n\r\n.. image:: https://readthedocs.org/projects/socon/badge/?version=latest\r\n    :target: https://socon.readthedocs.io/en/latest/\r\n    :alt: Documentation Status\r\n\r\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\r\n    :target: https://github.com/psf/black\r\n\r\n\r\nSocon is a high-level Python framework that helps you develop a generic and\r\nrobust framework for your different projects. Let us forget about\r\nwriting hundred of scripts with thousands of configurations, this framework\r\nwill help your organize your work and will speed your development.\r\n\r\nSocon's create a generic Django like project structure. It's a structure that contains\r\nall the element for you to get started with your framework and all\r\nyour different projects.\r\n\r\nWhy Socon ?\r\n===========\r\n\r\nI believe we have all ended-up in a situation where we have had multiple\r\nprojects that need to share the same scripts or components. Some projects may need a\r\nspecific configuration or a specific function to be executed. Also, we often\r\nspend a great amount of time writing a script that is not generic enough to be used by\r\nall of our different projects.\r\n\r\nSocon has been designed to simplify all that. Socon works with commands.\r\nSocon will let you define common commands that can be shared across projects.\r\nEach project can either write their own commands, or override common commands\r\nto change their behaviors by adding or removing functionalities.\r\n\r\nThe framework also provide features like managers and hooks. These features will\r\nallow you to increase the functionalities of your framework while maintaining\r\ngenericity across your different projects.\r\n\r\nDocumentation\r\n=============\r\n\r\nThe full documentation is in the \"``docs``\" directory on `GitHub`_ or online at\r\nhttps://socon.readthedocs.io/en/latest/\r\n\r\nIf you are just getting started, We recommend that you read the documentation in this\r\norder:\r\n\r\n* Read ``docs/intro/install.txt`` for instructions on how to install Socon.\r\n\r\n* Walk through each tutorial in numerical order: ``docs/intro/tutorials``\r\n\r\n* Jump to the ``docs/how-to`` for specific problems and use-cases.\r\n\r\n* Checkout the ``docs/ref`` for more details about API's and functionalities.\r\n\r\nCheck ``docs/README`` for instructions on building an HTML version of the docs.\r\n\r\nExample\r\n=======\r\n\r\nLet's imagine that you have two different projects. One project called ``artemis``\r\nand the other one ``apollo``. Both of these NASA projects need to launch a different\r\nrocket.\r\n\r\nThere are two possibilities:\r\n\r\n* Write a different scripts for each project but you lose the genericity.\r\n\r\n* Or write a generic script that will load a configuration file with\r\n  the information of both rockets and the launch procedure.\r\n  This will be the best solution, but it will be time consuming\r\n  and might not take into account all the possibilities.\r\n\r\nSocon was created to facilitate the second method. You are able to create common\r\ncommands that are available to all projects you have created\r\nusing the ``createproject`` command.\r\n\r\n.. code-block:: python\r\n\r\n    from socon.core.management.base import ProjectCommand, Config\r\n    from socon.core.registry.base import ProjectConfig\r\n\r\n\r\n    class LaunchCommand(ProjectCommand):\r\n        name = 'launch'\r\n\r\n        def handle(self, config: Config, project_config: ProjectConfig):\r\n            spacecraft = project_config.get_setting('SPACECRAFT')\r\n            print(f'Launching the {spacecraft} SpaceCraft to the moon')\r\n\r\nThis command is declared in the common space of your framework created by the\r\n``createcontainer`` command.\r\n\r\nWe are using a project_config object to load the name of the spacecraft.\r\nThis project_config object is loaded when you start the command and you specify the\r\nproject.\r\n\r\nThe ``SPACECRAFT`` variable is stored in a file called ``config.py`` at the root of\r\nevery project created by the command ``createproject``.\r\n\r\n.. code-block:: python\r\n\r\n    # Artemis config.py\r\n    SPACECRAFT = 'Artemis 1'\r\n\r\n.. code-block:: python\r\n\r\n    # Apollo config.py\r\n    SPACECRAFT = 'Saturn V'\r\n\r\nNow that everything is setup. You can just run the following:\r\n\r\n.. code-block:: console\r\n\r\n    $ python manage.py launch --project artemis\r\n    $ Launching the Artemis 1 SpaceCraft the the moon\r\n\r\n    $ python manage.py launch --project apollo\r\n    $ Launching the Saturn V SpaceCraft the the moon\r\n\r\nOf course the framework capabilities do not stop here. You can go even further,\r\nfor example by redefining functionalities of the launch command.\r\n\r\nWe invite you to walk through each tutorial in numerical\r\norder here: ``docs/intro/tutorials``\r\n\r\n\r\nContribution\r\n============\r\n\r\nAnyone can contribute to Socon's development. Checkout our documentation\r\non how to get involved: `https://socon.readthedocs.io/en/latest/internals/contributing.html`\r\n\r\nThis is a one man show for now, send help!\r\n\r\nLicense\r\n=======\r\n\r\nCopyright Stephane Capponi and others, 2023\r\nDistributed under the terms of the BSD-3-Clause license, Socon is free and\r\nopen source software.\r\n\r\nSocon also reused codes from third-party. You can find the licenses of these\r\nthird-party in the `licenses`_ folder. Each files that has been reused and\r\nmodified contains an SPDX section to specify the license used and the Copyright.\r\nIf you want more information about our license and why we reused code\r\nfrom third-party, check the ``docs/intro/overview.txt``\r\n\r\n.. _licenses: https://github.com/socon-dev/socon/tree/master/licenses\r\n.. _GitHub: https://github.com/socon-dev/socon/\r\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "A high-level Python framework that enables you to develop a generic, robust and reliable framework for your different projects.",
    "version": "0.2",
    "project_urls": {
        "changelog": "https://github.com/socon-dev/socon/blob/master/docs/internals/changelog.txt",
        "homepage": "https://socon.readthedocs.io/en/latest/",
        "repository": "https://github.com/socon-dev/socon"
    },
    "split_keywords": [
        "projects",
        "socon",
        "scripts",
        "commands"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8bb382542f5748f69cd1c71d5640f87adc94b585af1c3976ae838d7c24348a5c",
                "md5": "8b74cc266006a7461d3df1963e9385a3",
                "sha256": "ed6f89faecf6e2f07d18f1125dc607b6ef12555b27bcbddd573f2c6c7c9cc3b3"
            },
            "downloads": -1,
            "filename": "socon-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8b74cc266006a7461d3df1963e9385a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 54603,
            "upload_time": "2023-08-10T19:48:25",
            "upload_time_iso_8601": "2023-08-10T19:48:25.235445Z",
            "url": "https://files.pythonhosted.org/packages/8b/b3/82542f5748f69cd1c71d5640f87adc94b585af1c3976ae838d7c24348a5c/socon-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26516864333f8363243e4660810c58b81034ce56ea6272f75baee8816c6fe80e",
                "md5": "b8729217b6c856124db5deb33107d746",
                "sha256": "262f87f756da823c2984e9a9cf8818279de23107b0cf593249a8140adbb459ae"
            },
            "downloads": -1,
            "filename": "socon-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b8729217b6c856124db5deb33107d746",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 127950,
            "upload_time": "2023-08-10T19:48:28",
            "upload_time_iso_8601": "2023-08-10T19:48:28.143625Z",
            "url": "https://files.pythonhosted.org/packages/26/51/6864333f8363243e4660810c58b81034ce56ea6272f75baee8816c6fe80e/socon-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-10 19:48:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "socon-dev",
    "github_project": "socon",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "socon"
}
        
Elapsed time: 1.77519s