confluent


Nameconfluent JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/monstermichl/confluent.git
Summaryconfluent keeps your language specific configs in sync
upload_time2024-02-21 09:20:10
maintainer
docs_urlNone
authormonstermichl
requires_python>=3.10
license
keywords multi distributed configuration generator confluent languages distribution java javascript typescript python c go
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # confluent
In times of distributed systems and en vogue micro-architecture it can get quite cumbersome to keep constants that are required by several components up-to-date and in sync. It can get especially hard when these components or services are written in different languages. *confluent* targets this issue by using a language neutral YAML configuration that lets you generate language specific config files in the style of classes, structs or consts.

## Example
Alright, after all this confusing nerd-talk, lets just have a look at a simple example to see what *confluent* can do for you.

The example YAML file contains a property named **opener** with the value **Hello World**. Output files shall be generated for *TypeScript*, *Python* and *C*. In addition, the *C*-file shall be distributed to a Git server's *config*-folder (for more information please have a look at [test-config.yaml](https://github.com/monstermichl/confluent/blob/2bce469b112c4da295026b00d0421ac50995ed3c/example/test-config.yaml#L81)).

### Input (readme-config.yaml)
```yaml
languages:
  - type: typescript
    property_naming: screaming_snake
    export: esm

  - type: python
    file_naming: snake
    property_naming: screaming_snake

  - type: c
    file_naming: snake
    property_naming: pascal
    distributions:
      - type: git
        path: config
        url: https://github.com/idontknow/example.git

properties:
  - type: string
    name: opener
    value: Hello World
```

### Execute confluent
```bash
# -d is used to distribute the C-file to Git.
python3 -m confluent -c readme-config.yaml -d
```

### Output (readme-config.ts)
```typescript
export const ReadmeConfig = {
    OPENER: 'Hello World',
} as const;
```

### Output (readme_config.py)
```python
class ReadmeConfig:
    OPENER = 'Hello World'
```

### Output (readme_config.h)
```c
#ifndef README_CONFIG_H
#define README_CONFIG_H

/* Generated with confluent v0.3.0 (https://pypi.org/project/confluent/). */
const struct {
    char* Opener;
} ReadmeConfig = {
    "Hello World",
};

#endif /* README_CONFIG_H */
```

## Currently supported languages
- [x] Java
- [x] JavaScript
- [x] TypeScript
- [x] Python
- [x] C
- [x] Go

## Installation
```bash
python3 -m pip install confluent
```

## Configuration
For detailed configuration information, please check [example/test-config.yaml](https://github.com/monstermichl/confluent/blob/main/example/test-config.yaml). All possible values are described there.

## Usage
### Commandline
```bash
# For more information run "python3 -m confluent -h".
python3 -m confluent -c test-config.yaml -o generated
```

### Script
```python
from confluent import Orchestrator

# Create Orchestrator instance from file.
orchestrator = Orchestrator.read_config('test-config.yaml')

# Write configs to 'generated' directory.
orchestrator.write('generated')

# Distribute configs (if required).
orchestrator.distribute()
```

## How to participate
If you feel that there's a need for another language, feel free to add it. For detailed information how to add support for a new language, please refer to [README.md](https://github.com/monstermichl/confluent/tree/main/misc/language_support/README.md).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/monstermichl/confluent.git",
    "name": "confluent",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "multi,distributed,configuration,generator,confluent,languages,distribution,java,javascript,typescript,python,c,go",
    "author": "monstermichl",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/0d/5e/563363cc6b503c6c8c0f86bdce55803dfe69d7bf133a1c5acbf80a84f735/confluent-0.3.1.tar.gz",
    "platform": null,
    "description": "# confluent\nIn times of distributed systems and en vogue micro-architecture it can get quite cumbersome to keep constants that are required by several components up-to-date and in sync. It can get especially hard when these components or services are written in different languages. *confluent* targets this issue by using a language neutral YAML configuration that lets you generate language specific config files in the style of classes, structs or consts.\n\n## Example\nAlright, after all this confusing nerd-talk, lets just have a look at a simple example to see what *confluent* can do for you.\n\nThe example YAML file contains a property named **opener** with the value **Hello World**. Output files shall be generated for *TypeScript*, *Python* and *C*. In addition, the *C*-file shall be distributed to a Git server's *config*-folder (for more information please have a look at [test-config.yaml](https://github.com/monstermichl/confluent/blob/2bce469b112c4da295026b00d0421ac50995ed3c/example/test-config.yaml#L81)).\n\n### Input (readme-config.yaml)\n```yaml\nlanguages:\n  - type: typescript\n    property_naming: screaming_snake\n    export: esm\n\n  - type: python\n    file_naming: snake\n    property_naming: screaming_snake\n\n  - type: c\n    file_naming: snake\n    property_naming: pascal\n    distributions:\n      - type: git\n        path: config\n        url: https://github.com/idontknow/example.git\n\nproperties:\n  - type: string\n    name: opener\n    value: Hello World\n```\n\n### Execute confluent\n```bash\n# -d is used to distribute the C-file to Git.\npython3 -m confluent -c readme-config.yaml -d\n```\n\n### Output (readme-config.ts)\n```typescript\nexport const ReadmeConfig = {\n    OPENER: 'Hello World',\n} as const;\n```\n\n### Output (readme_config.py)\n```python\nclass ReadmeConfig:\n    OPENER = 'Hello World'\n```\n\n### Output (readme_config.h)\n```c\n#ifndef README_CONFIG_H\n#define README_CONFIG_H\n\n/* Generated with confluent v0.3.0 (https://pypi.org/project/confluent/). */\nconst struct {\n    char* Opener;\n} ReadmeConfig = {\n    \"Hello World\",\n};\n\n#endif /* README_CONFIG_H */\n```\n\n## Currently supported languages\n- [x] Java\n- [x] JavaScript\n- [x] TypeScript\n- [x] Python\n- [x] C\n- [x] Go\n\n## Installation\n```bash\npython3 -m pip install confluent\n```\n\n## Configuration\nFor detailed configuration information, please check [example/test-config.yaml](https://github.com/monstermichl/confluent/blob/main/example/test-config.yaml). All possible values are described there.\n\n## Usage\n### Commandline\n```bash\n# For more information run \"python3 -m confluent -h\".\npython3 -m confluent -c test-config.yaml -o generated\n```\n\n### Script\n```python\nfrom confluent import Orchestrator\n\n# Create Orchestrator instance from file.\norchestrator = Orchestrator.read_config('test-config.yaml')\n\n# Write configs to 'generated' directory.\norchestrator.write('generated')\n\n# Distribute configs (if required).\norchestrator.distribute()\n```\n\n## How to participate\nIf you feel that there's a need for another language, feel free to add it. For detailed information how to add support for a new language, please refer to [README.md](https://github.com/monstermichl/confluent/tree/main/misc/language_support/README.md).\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "confluent keeps your language specific configs in sync",
    "version": "0.3.1",
    "project_urls": {
        "Homepage": "https://github.com/monstermichl/confluent.git"
    },
    "split_keywords": [
        "multi",
        "distributed",
        "configuration",
        "generator",
        "confluent",
        "languages",
        "distribution",
        "java",
        "javascript",
        "typescript",
        "python",
        "c",
        "go"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7d38df24e4ace8316dd3e95c1892dc65554486ac2fdfd8332a6ae13841c4b63",
                "md5": "ba7f082a119fc9dd2fc23e5e9e9b6144",
                "sha256": "814f4ca34648ca7b087db5313579f9970adbb246e1dc28cd67d26de2ba9e36f5"
            },
            "downloads": -1,
            "filename": "confluent-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba7f082a119fc9dd2fc23e5e9e9b6144",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 39063,
            "upload_time": "2024-02-21T09:20:09",
            "upload_time_iso_8601": "2024-02-21T09:20:09.035030Z",
            "url": "https://files.pythonhosted.org/packages/f7/d3/8df24e4ace8316dd3e95c1892dc65554486ac2fdfd8332a6ae13841c4b63/confluent-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d5e563363cc6b503c6c8c0f86bdce55803dfe69d7bf133a1c5acbf80a84f735",
                "md5": "73b6da890b775b259c977568c991c0e7",
                "sha256": "3a2eb880319b725a3af430c3a01d87f1f06180545fd07073fd59bfb3c4641601"
            },
            "downloads": -1,
            "filename": "confluent-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "73b6da890b775b259c977568c991c0e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 28451,
            "upload_time": "2024-02-21T09:20:10",
            "upload_time_iso_8601": "2024-02-21T09:20:10.623651Z",
            "url": "https://files.pythonhosted.org/packages/0d/5e/563363cc6b503c6c8c0f86bdce55803dfe69d7bf133a1c5acbf80a84f735/confluent-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 09:20:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "monstermichl",
    "github_project": "confluent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "confluent"
}
        
Elapsed time: 0.25443s