Quick Start Guide
Welcome to Unoplat Code Confluence
Unoplat Code Confluence currently supports Python codebases and is in alpha stage. We're actively working on expanding language support and features.
Table of Contents
Introduction
The current version supports parsing codebases and exporting a JSON representation of code graph. For more details, check out:
Prerequisites
Codebase Requirements
Currently supports Python codebases up to 3.11 (due to dependency on isort)
Code Confluence relies on two powerful tools for import segregation and dependency analysis:
Required Configurations
1. Ruff Configuration
Create a ruff.toml
file in your project root:
target-version = "py311"
exclude = [
".git",
".mypy_cache",
".pytest_cache",
".ruff_cache",
".venv",
"venv",
"build",
"dist",
]
src = ["unoplat_code_confluence"] # Adjust this to your project's source directory
line-length = 320
[lint]
# Enable only flake8-tidy-imports
select = ["I","E402","INP001","TID","F401","F841"]
[lint.per-file-ignores]
"__init__.py" = ["E402","F401"]
[lint.flake8-tidy-imports]
ban-relative-imports = "all"
[lint.isort]
combine-as-imports = true
force-to-top = ["os","sys"]
Run Ruff with:
ruff check --fix . --unsafe-fixes
2. isort Configuration
Create an .isort.cfg
file:
[settings]
known_third_party = "Include third party dependencies here"
import_heading_stdlib = Standard Library
import_heading_thirdparty = Third Party
import_heading_firstparty = First Party
import_heading_localfolder = Local
py_version = 311
line_length = 500
Run isort with:
isort . --python-version 311
This configuration is temporary for the alpha version and will be automated in future releases.
Installation Requirements
Before starting, install these tools:
pipx install poetry
Installation
1. Python Setup
pyenv install 3.12.1
pyenv global 3.12.1
2. Install Code Confluence
pipx install --python $(pyenv which python) 'git+https://github.com/unoplat/unoplat-code-confluence.git@unoplat-code-confluence-v0.17.0#subdirectory=unoplat-code-confluence'
Configuration
JSON Configuration
All configuration fields support environment variable overrides using the UNOPLAT_
prefix.
Required Fields
repositories: Array of repositories to analyze
git_url
: Repository URLoutput_path
: Analysis output directorycodebases
: Array of codebase configurationscodebase_folder_name
: Codebase directory nameroot_package_name
: Root package nameprogramming_language_metadata
: Language configlanguage
: Programming languagepackage_manager
: Package manager typelanguage_version
: Language version
archguard: ArchGuard tool configuration
download_url
: ArchGuard download URLdownload_directory
: Local storage directory
logging_handlers: Logging configuration
sink
: Log file pathformat
: Log message formatrotation
: Log rotation sizeretention
: Log retention periodlevel
: Logging level
Example Configuration
{
"repositories": [
{
"git_url": "https://github.com/unoplat/unoplat-code-confluence",
"output_path": "/Users/jayghiya/Documents/unoplat",
"codebases": [
{
"codebase_folder_name": "unoplat-code-confluence",
"root_package_name": "unoplat_code_confluence",
"programming_language_metadata": {
"language": "python",
"package_manager": "poetry",
"language_version": "3.12.0"
}
}
]
}
],
"archguard": {
"download_url": "archguard/archguard",
"download_directory": "/Users/jayghiya/Documents/unoplat"
},
"logging_handlers": [
{
"sink": "~/Documents/unoplat/app.log",
"format": "<green>{time:YYYY-MM-DD at HH:mm:ss}</green> | <level>{level}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> | <magenta>{thread.name}</magenta> - <level>{message}</level>",
"rotation": "10 MB",
"retention": "10 days",
"level": "DEBUG"
}
]
}
Environment Variables
Create a .env.dev
file:
UNOPLAT_ENV=dev
UNOPLAT_DEBUG=true
UNOPLAT_GITHUB_TOKEN=Your_Github_Pat_Token
Running the Application
unoplat-code-confluence --config /path/to/your/config.json
Troubleshooting
If you encounter any issues, please check:
- Python version compatibility
- Environment variable configuration
- JSON configuration syntax
- For Code Grammar issues please check out current issues and possible resolutions on GitHub page.
For more help, visit our GitHub Issues page or join our Discord community.