Skip to main content
https://img.shields.io/badge/python-3.9-blue.svg https://github.com/socon-dev/socon/actions/workflows/tests.yml/badge.svg Code coverage Status https://github.com/socon-dev/socon/actions/workflows/linters.yml/badge.svg Documentation Status https://img.shields.io/badge/code%20style-black-000000.svg

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.

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.

# Artemis config.py
SPACECRAFT = 'Artemis 1'
# Apollo config.py
SPACECRAFT = 'Saturn V'

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

$ 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

Metadata

Release files for socon 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for socon 0.2.1
File Size Uploaded Provenance Actions
socon-0.2.1.tar.gz 128.4 kB Without provenance Details for socon-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for socon 0.2.1
File Interpreter ABI Platform Actions
socon-0.2.1-py3-none-any.whl Python 3 none any Details for socon-0.2.1-py3-none-any.whl

Total release size: 183.8 kB

Release files / socon-0.2.1.tar.gz

Download URL socon-0.2.1.tar.gz
Size 128.4 kB
Tags Source
SHA-256 checksum
How to use checksums
06033a90e1575316f6bdb2a7a90b300a2e21e55b15a07baaae4facc99e91a08e
BLAKE2b-256 checksum
How to use checksums
d87624b866638e30ebd15cba170df0a916f81c0fce5b6836ed862d5ca7a230da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release files / socon-0.2.1-py3-none-any.whl

Download URL socon-0.2.1-py3-none-any.whl
Size 55.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7baf2cf07e561e76f5e6b4442a74baf657cda4033419569b26ced38d41367ee6
BLAKE2b-256 checksum
How to use checksums
3d94ab727ea0ff0be62b1c8a23d47d9da887a01b8ea5302f6a5cc68fa5749c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Security for socon 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page