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/")
)

Query a separate FreeSchema server

After initialization, pass a hostname to override the server for one query:

from ccs import FreeschemaQuery, schema_query_listener, freeschema_query_api

query = FreeschemaQuery(type="the_person")
query_url = "wico.freeschema.com"

result = await schema_query_listener(query, url=query_url)
# Or retrieve the raw API response:
raw_result = await freeschema_query_api(query, url=query_url)

wico.freeschema.com resolves to https://wico.freeschema.com/api/freeschema-query. You can also pass an origin such as https://wico.freeschema.com/ or a full endpoint URL. Explicit endpoint paths are preserved, and explicit http:// URLs are supported for local servers. Omitting url (or passing None) uses the existing configured query endpoint. The dictionary-based freeschema_query_raw helper also accepts url. The override affects only the query request. Authentication and any concept or connection lookups needed for formatting still use the existing configuration.

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.

Metadata

Release files for mftsccs 0.1.18

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.18
File Size Uploaded Provenance Actions
mftsccs-0.1.18.tar.gz 65.1 kB Without provenance Details for mftsccs-0.1.18.tar.gz

Built distribution (wheel)

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

Total release size: 142.3 kB

Release files / mftsccs-0.1.18.tar.gz

Download URL mftsccs-0.1.18.tar.gz
Size 65.1 kB
Tags Source
SHA-256 checksum
How to use checksums
62df5e10b1ab5afd58d56164d50fa08c7d311860b3841ee0373857622444c4c4
BLAKE2b-256 checksum
How to use checksums
c5e479b986140ed13becef0258a86a30adaf9cb26e5390d9d87bd0dd6a827a34
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.18-py3-none-any.whl

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

Security for mftsccs 0.1.18

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