Skip to main content

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

Initialization

from ccs import init, CCSConfig

await init(
    url="https://api.example.com",
    nodeUrl="https://node.example.com",
    applicationName="MyApp",
    config=CCSConfig(storagePath="./data/ccs/")
)

Get instance concept by character value and type

Fetches a concept from the backend that matches a given character value and type string (e.g. a URL tagged as "the_source_url").

from ccs.api import GetInstanceConceptByCharacterType

concept = await GetInstanceConceptByCharacterType(
    characterValue="https://www.google.com/maps/place/gorjana/data=...",
    type="the_source_url",
)

if concept.id != 0:
    print(concept.id)             # server-assigned concept ID
    print(concept.characterValue) # the matched character value

Request body sent to /api/get_instance_concept_by_character_type:

{
    "characterValue": "https://...",
    "type": "the_source_url"
}

Returns a Concept object. If no match is found or an error occurs, returns a default empty Concept with id=0.

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.

Release files for mftsccs 0.1.17

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

Source distribution (sdist)

Source distribution for mftsccs 0.1.17
File Size Uploaded
mftsccs-0.1.17.tar.gz 64.0 kB Details

Built distribution (wheel)

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

Total release size: 140.3 kB

Release files / mftsccs-0.1.17.tar.gz

Download URL mftsccs-0.1.17.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f320aeb177bb70f9980068b5dbf406c52791bc0440a78b7f155636d868856eec
BLAKE2b-256 checksum
How to use checksums
3d4b0ef7d818ff89de30461cef70be1abbd1e73ee41acce93ac6f78edb965dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / mftsccs-0.1.17-py3-none-any.whl

Download URL mftsccs-0.1.17-py3-none-any.whl
Size 76.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a102590eb2f6c6f8a7e389fd0ed1a71f64af184ff4291f436a2d879883aac191
BLAKE2b-256 checksum
How to use checksums
8c9aa168ba9a387c5265d8d2a37e3116870aac5a213e7297b13c55cf5d1292a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.17 This release

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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