A Python library for Concept-Connection System (CCS) - offline-first knowledge graph management
Project description
CCS
A Python library for CCS functionality.
Installation
From source (development mode)
# Clone the repository
git clone https://github.com/yourusername/ccs.git
cd ccs
# Install in development mode
pip install -e .
# Install with development dependencies
pip install -e ".[dev]"
From PyPI (once published)
pip install ccs
Usage
# Import the main functions and classes
from ccs import example_function, ExampleClass, helper_function
# Use example_function
result = example_function("hello")
print(result) # Output: Processed: hello
# Use ExampleClass
obj = ExampleClass("my_instance")
obj.process("some data")
print(obj) # Output: ExampleClass(name='my_instance', data=some data)
# Use helper_function
first_item = helper_function([1, 2, 3])
print(first_item) # Output: 1
Import specific modules
from ccs.core import ExampleClass
from ccs.utils import flatten_list, validate_input
# Flatten nested lists
flat = flatten_list([[1, 2], [3, 4]])
print(flat) # Output: [1, 2, 3, 4]
# Validate input types
is_valid = validate_input("hello", str)
print(is_valid) # Output: True
Login output formatting (frontend-friendly)
Use the package to call backend login and return a normalized payload that your frontend can store directly.
from ccs import init, CCSConfig, login, format_login_payload
await init(
url="https://boomconsole.com",
nodeUrl="https://boomconsole.com",
applicationName="boomconsole",
config=CCSConfig(storagePath="./data/ccs/")
)
# Calls /api/auth/login and returns normalized payload.
# By default this does NOT persist login data.
payload = await login("user@example.com", "password")
print(payload)
# If you already have raw backend login JSON, just format it:
normalized = format_login_payload(raw_login_response, fallback_email="user@example.com")
Normalized output shape:
{
"token": "...",
"refreshToken": "...",
"email": "user@example.com",
"userId": 10489,
"userConcept": 100417172,
"entityId": 100827857,
"amcode": "base64-encoded-roles-json"
}
Optional storage behavior:
# Only if you explicitly want package-level storage:
payload = await login("user@example.com", "password", store_session=True, persist=True)
Project Structure
CCS-Python/
├── pyproject.toml # Package configuration
├── README.md # This file
├── src/
│ └── ccs/ # Main package
│ ├── __init__.py # Package initialization & exports
│ ├── core.py # Core functionality
│ └── utils.py # Utility functions
├── tests/ # Test suite
│ ├── __init__.py
│ ├── test_core.py
│ └── test_utils.py
└── docs/ # Documentation (optional)
Development
Running tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=ccs
Code formatting
# Format code with black
black src/ tests/
# Lint with ruff
ruff check src/ tests/
Type checking
mypy src/
Building & Publishing
Build the package
pip install build
python -m build
This creates distribution files in the dist/ directory:
ccs-0.1.0.tar.gz(source distribution)ccs-0.1.0-py3-none-any.whl(wheel distribution)
Publish to PyPI
pip install twine
# Upload to TestPyPI first (recommended)
twine upload --repository testpypi dist/*
# Upload to PyPI
twine upload dist/*
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mftsccs-0.1.13.tar.gz.
File metadata
- Download URL: mftsccs-0.1.13.tar.gz
- Upload date:
- Size: 58.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61e85982f95dc509dbf279b40f945fcc8b52387b626bdc009dffed7878edf0a6
|
|
| MD5 |
d3a130d49cee947af4c762c316399cbf
|
|
| BLAKE2b-256 |
e1dc1241bdac5288ccbe60b6097612c871bef689405cb115900ed9126dd60cd4
|
File details
Details for the file mftsccs-0.1.13-py3-none-any.whl.
File metadata
- Download URL: mftsccs-0.1.13-py3-none-any.whl
- Upload date:
- Size: 73.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82ab094112d1b14b07a5aa4d20322f0d7c67065b51db4fac13a87e492b0769db
|
|
| MD5 |
9262f172fdef65566f2eeb0a5ef16c38
|
|
| BLAKE2b-256 |
2d221b4b80960c2dbb2092d278c88d3cb981ed2d1caaca824bf2422ea0feed51
|