mftsccs 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. mftsccs-0.1.0/LICENSE +21 -0
  2. mftsccs-0.1.0/PKG-INFO +171 -0
  3. mftsccs-0.1.0/README.md +138 -0
  4. mftsccs-0.1.0/pyproject.toml +68 -0
  5. mftsccs-0.1.0/setup.cfg +4 -0
  6. mftsccs-0.1.0/src/ccs/__init__.py +117 -0
  7. mftsccs-0.1.0/src/ccs/config/__init__.py +11 -0
  8. mftsccs-0.1.0/src/ccs/config/base_url.py +260 -0
  9. mftsccs-0.1.0/src/ccs/config/token_storage.py +98 -0
  10. mftsccs-0.1.0/src/ccs/core.py +72 -0
  11. mftsccs-0.1.0/src/ccs/data/__init__.py +17 -0
  12. mftsccs-0.1.0/src/ccs/data/inner_actions.py +42 -0
  13. mftsccs-0.1.0/src/ccs/data/local_concept_data.py +232 -0
  14. mftsccs-0.1.0/src/ccs/data/local_connection_data.py +206 -0
  15. mftsccs-0.1.0/src/ccs/data/local_id.py +70 -0
  16. mftsccs-0.1.0/src/ccs/data/local_sync_data.py +458 -0
  17. mftsccs-0.1.0/src/ccs/init.py +181 -0
  18. mftsccs-0.1.0/src/ccs/models/__init__.py +13 -0
  19. mftsccs-0.1.0/src/ccs/models/concept.py +112 -0
  20. mftsccs-0.1.0/src/ccs/models/connection.py +105 -0
  21. mftsccs-0.1.0/src/ccs/services/__init__.py +24 -0
  22. mftsccs-0.1.0/src/ccs/services/local/__init__.py +32 -0
  23. mftsccs-0.1.0/src/ccs/services/local/create_the_concept_local.py +125 -0
  24. mftsccs-0.1.0/src/ccs/services/local/create_the_connection_local.py +318 -0
  25. mftsccs-0.1.0/src/ccs/services/local/get_concept_by_character_local.py +31 -0
  26. mftsccs-0.1.0/src/ccs/services/local/helpers.py +37 -0
  27. mftsccs-0.1.0/src/ccs/services/local/make_the_concept_local.py +74 -0
  28. mftsccs-0.1.0/src/ccs/services/local/make_the_instance_concept_local.py +287 -0
  29. mftsccs-0.1.0/src/ccs/services/local/make_the_type_local.py +131 -0
  30. mftsccs-0.1.0/src/ccs/services/transaction/__init__.py +9 -0
  31. mftsccs-0.1.0/src/ccs/services/transaction/local_transaction.py +440 -0
  32. mftsccs-0.1.0/src/ccs/utils.py +60 -0
  33. mftsccs-0.1.0/src/mftsccs.egg-info/PKG-INFO +171 -0
  34. mftsccs-0.1.0/src/mftsccs.egg-info/SOURCES.txt +37 -0
  35. mftsccs-0.1.0/src/mftsccs.egg-info/dependency_links.txt +1 -0
  36. mftsccs-0.1.0/src/mftsccs.egg-info/requires.txt +8 -0
  37. mftsccs-0.1.0/src/mftsccs.egg-info/top_level.txt +1 -0
  38. mftsccs-0.1.0/tests/test_core.py +44 -0
  39. mftsccs-0.1.0/tests/test_utils.py +49 -0
mftsccs-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Your Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
mftsccs-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: mftsccs
3
+ Version: 0.1.0
4
+ Summary: A Python library for Concept-Connection System (CCS) - offline-first knowledge graph management
5
+ Author-email: Boomconsole <nischal@boomconsole.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://freeschema.com
8
+ Project-URL: Documentation, https://freeschema.com
9
+ Project-URL: Repository, https://github.com/Mentor-Friends/CCS-PYTHON
10
+ Project-URL: Issues, https://github.com/Mentor-Friends/CCS-PYTHON/issues
11
+ Keywords: ccs,library,utilities
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: aiohttp>=3.8.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0; extra == "dev"
28
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
29
+ Requires-Dist: black>=23.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
31
+ Requires-Dist: mypy>=1.0; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # CCS
35
+
36
+ A Python library for CCS functionality.
37
+
38
+ ## Installation
39
+
40
+ ### From source (development mode)
41
+
42
+ ```bash
43
+ # Clone the repository
44
+ git clone https://github.com/yourusername/ccs.git
45
+ cd ccs
46
+
47
+ # Install in development mode
48
+ pip install -e .
49
+
50
+ # Install with development dependencies
51
+ pip install -e ".[dev]"
52
+ ```
53
+
54
+ ### From PyPI (once published)
55
+
56
+ ```bash
57
+ pip install ccs
58
+ ```
59
+
60
+ ## Usage
61
+
62
+ ```python
63
+ # Import the main functions and classes
64
+ from ccs import example_function, ExampleClass, helper_function
65
+
66
+ # Use example_function
67
+ result = example_function("hello")
68
+ print(result) # Output: Processed: hello
69
+
70
+ # Use ExampleClass
71
+ obj = ExampleClass("my_instance")
72
+ obj.process("some data")
73
+ print(obj) # Output: ExampleClass(name='my_instance', data=some data)
74
+
75
+ # Use helper_function
76
+ first_item = helper_function([1, 2, 3])
77
+ print(first_item) # Output: 1
78
+ ```
79
+
80
+ ### Import specific modules
81
+
82
+ ```python
83
+ from ccs.core import ExampleClass
84
+ from ccs.utils import flatten_list, validate_input
85
+
86
+ # Flatten nested lists
87
+ flat = flatten_list([[1, 2], [3, 4]])
88
+ print(flat) # Output: [1, 2, 3, 4]
89
+
90
+ # Validate input types
91
+ is_valid = validate_input("hello", str)
92
+ print(is_valid) # Output: True
93
+ ```
94
+
95
+ ## Project Structure
96
+
97
+ ```
98
+ CCS-Python/
99
+ ├── pyproject.toml # Package configuration
100
+ ├── README.md # This file
101
+ ├── src/
102
+ │ └── ccs/ # Main package
103
+ │ ├── __init__.py # Package initialization & exports
104
+ │ ├── core.py # Core functionality
105
+ │ └── utils.py # Utility functions
106
+ ├── tests/ # Test suite
107
+ │ ├── __init__.py
108
+ │ ├── test_core.py
109
+ │ └── test_utils.py
110
+ └── docs/ # Documentation (optional)
111
+ ```
112
+
113
+ ## Development
114
+
115
+ ### Running tests
116
+
117
+ ```bash
118
+ # Install dev dependencies
119
+ pip install -e ".[dev]"
120
+
121
+ # Run tests
122
+ pytest
123
+
124
+ # Run tests with coverage
125
+ pytest --cov=ccs
126
+ ```
127
+
128
+ ### Code formatting
129
+
130
+ ```bash
131
+ # Format code with black
132
+ black src/ tests/
133
+
134
+ # Lint with ruff
135
+ ruff check src/ tests/
136
+ ```
137
+
138
+ ### Type checking
139
+
140
+ ```bash
141
+ mypy src/
142
+ ```
143
+
144
+ ## Building & Publishing
145
+
146
+ ### Build the package
147
+
148
+ ```bash
149
+ pip install build
150
+ python -m build
151
+ ```
152
+
153
+ This creates distribution files in the `dist/` directory:
154
+ - `ccs-0.1.0.tar.gz` (source distribution)
155
+ - `ccs-0.1.0-py3-none-any.whl` (wheel distribution)
156
+
157
+ ### Publish to PyPI
158
+
159
+ ```bash
160
+ pip install twine
161
+
162
+ # Upload to TestPyPI first (recommended)
163
+ twine upload --repository testpypi dist/*
164
+
165
+ # Upload to PyPI
166
+ twine upload dist/*
167
+ ```
168
+
169
+ ## License
170
+
171
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,138 @@
1
+ # CCS
2
+
3
+ A Python library for CCS functionality.
4
+
5
+ ## Installation
6
+
7
+ ### From source (development mode)
8
+
9
+ ```bash
10
+ # Clone the repository
11
+ git clone https://github.com/yourusername/ccs.git
12
+ cd ccs
13
+
14
+ # Install in development mode
15
+ pip install -e .
16
+
17
+ # Install with development dependencies
18
+ pip install -e ".[dev]"
19
+ ```
20
+
21
+ ### From PyPI (once published)
22
+
23
+ ```bash
24
+ pip install ccs
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ```python
30
+ # Import the main functions and classes
31
+ from ccs import example_function, ExampleClass, helper_function
32
+
33
+ # Use example_function
34
+ result = example_function("hello")
35
+ print(result) # Output: Processed: hello
36
+
37
+ # Use ExampleClass
38
+ obj = ExampleClass("my_instance")
39
+ obj.process("some data")
40
+ print(obj) # Output: ExampleClass(name='my_instance', data=some data)
41
+
42
+ # Use helper_function
43
+ first_item = helper_function([1, 2, 3])
44
+ print(first_item) # Output: 1
45
+ ```
46
+
47
+ ### Import specific modules
48
+
49
+ ```python
50
+ from ccs.core import ExampleClass
51
+ from ccs.utils import flatten_list, validate_input
52
+
53
+ # Flatten nested lists
54
+ flat = flatten_list([[1, 2], [3, 4]])
55
+ print(flat) # Output: [1, 2, 3, 4]
56
+
57
+ # Validate input types
58
+ is_valid = validate_input("hello", str)
59
+ print(is_valid) # Output: True
60
+ ```
61
+
62
+ ## Project Structure
63
+
64
+ ```
65
+ CCS-Python/
66
+ ├── pyproject.toml # Package configuration
67
+ ├── README.md # This file
68
+ ├── src/
69
+ │ └── ccs/ # Main package
70
+ │ ├── __init__.py # Package initialization & exports
71
+ │ ├── core.py # Core functionality
72
+ │ └── utils.py # Utility functions
73
+ ├── tests/ # Test suite
74
+ │ ├── __init__.py
75
+ │ ├── test_core.py
76
+ │ └── test_utils.py
77
+ └── docs/ # Documentation (optional)
78
+ ```
79
+
80
+ ## Development
81
+
82
+ ### Running tests
83
+
84
+ ```bash
85
+ # Install dev dependencies
86
+ pip install -e ".[dev]"
87
+
88
+ # Run tests
89
+ pytest
90
+
91
+ # Run tests with coverage
92
+ pytest --cov=ccs
93
+ ```
94
+
95
+ ### Code formatting
96
+
97
+ ```bash
98
+ # Format code with black
99
+ black src/ tests/
100
+
101
+ # Lint with ruff
102
+ ruff check src/ tests/
103
+ ```
104
+
105
+ ### Type checking
106
+
107
+ ```bash
108
+ mypy src/
109
+ ```
110
+
111
+ ## Building & Publishing
112
+
113
+ ### Build the package
114
+
115
+ ```bash
116
+ pip install build
117
+ python -m build
118
+ ```
119
+
120
+ This creates distribution files in the `dist/` directory:
121
+ - `ccs-0.1.0.tar.gz` (source distribution)
122
+ - `ccs-0.1.0-py3-none-any.whl` (wheel distribution)
123
+
124
+ ### Publish to PyPI
125
+
126
+ ```bash
127
+ pip install twine
128
+
129
+ # Upload to TestPyPI first (recommended)
130
+ twine upload --repository testpypi dist/*
131
+
132
+ # Upload to PyPI
133
+ twine upload dist/*
134
+ ```
135
+
136
+ ## License
137
+
138
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mftsccs" # Unique name on PyPI (ccs is likely taken)
7
+ version = "0.1.0"
8
+ description = "A Python library for Concept-Connection System (CCS) - offline-first knowledge graph management"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.8"
12
+ authors = [
13
+ {name = "Boomconsole", email = "nischal@boomconsole.com"} # Update with your info
14
+ ]
15
+ keywords = ["ccs", "library", "utilities"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.8",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ ]
28
+ dependencies = [
29
+ "aiohttp>=3.8.0",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ dev = [
34
+ "pytest>=7.0",
35
+ "pytest-cov>=4.0",
36
+ "black>=23.0",
37
+ "ruff>=0.1.0",
38
+ "mypy>=1.0",
39
+ ]
40
+
41
+ [project.urls]
42
+ Homepage = "https://freeschema.com"
43
+ Documentation = "https://freeschema.com"
44
+ Repository = "https://github.com/Mentor-Friends/CCS-PYTHON"
45
+ Issues = "https://github.com/Mentor-Friends/CCS-PYTHON/issues"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.black]
51
+ line-length = 88
52
+ target-version = ["py38", "py39", "py310", "py311", "py312"]
53
+
54
+ [tool.ruff]
55
+ line-length = 88
56
+ select = ["E", "F", "I", "N", "W", "UP"]
57
+
58
+ [tool.mypy]
59
+ python_version = "3.8"
60
+ warn_return_any = true
61
+ warn_unused_configs = true
62
+ ignore_missing_imports = true
63
+
64
+ [tool.pytest.ini_options]
65
+ testpaths = ["tests"]
66
+ python_files = ["test_*.py"]
67
+ python_functions = ["test_*"]
68
+ addopts = "-v --tb=short"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,117 @@
1
+ """
2
+ CCS - A Python library for Concept-Connection System functionality.
3
+
4
+ This package provides utilities and functions for creating and managing
5
+ concepts in a knowledge graph system with offline-first support.
6
+
7
+ Usage:
8
+ >>> from ccs import init, MakeTheInstanceConceptLocal, LocalTransaction
9
+ >>>
10
+ >>> async def main():
11
+ ... # Initialize the library first
12
+ ... await init(
13
+ ... url="https://api.freeschema.com",
14
+ ... accessToken="your-jwt-token"
15
+ ... )
16
+ ...
17
+ ... # Use LocalTransaction for batch operations
18
+ ... tx = LocalTransaction()
19
+ ... await tx.initialize()
20
+ ...
21
+ ... person = await tx.MakeTheInstanceConceptLocal(
22
+ ... type="the_person",
23
+ ... referent="",
24
+ ... composition=True,
25
+ ... userId=101
26
+ ... )
27
+ ... name = await tx.MakeTheInstanceConceptLocal(
28
+ ... type="the_name",
29
+ ... referent="Alice",
30
+ ... userId=101
31
+ ... )
32
+ ...
33
+ ... # Sync all at once
34
+ ... await tx.commitTransaction()
35
+ """
36
+
37
+ from ccs.core import example_function, ExampleClass
38
+ from ccs.utils import helper_function
39
+
40
+ # Initialization
41
+ from ccs.init import init, updateAccessToken, isInitialized, getConfig
42
+
43
+ # Configuration
44
+ from ccs.config import BaseUrl, TokenStorage
45
+
46
+ # Models
47
+ from ccs.models import Concept, create_default_concept, Connection, create_default_connection
48
+
49
+ # Data storage
50
+ from ccs.data import (
51
+ LocalConceptsData,
52
+ LocalConnectionData,
53
+ LocalSyncData,
54
+ LocalId,
55
+ InnerActions,
56
+ )
57
+
58
+ # Services - Local
59
+ from ccs.services.local import (
60
+ CreateTheConceptLocal,
61
+ MakeTheConceptLocal,
62
+ MakeTheTypeConceptLocal,
63
+ MakeTheInstanceConceptLocal,
64
+ GetConceptByCharacterAndCategoryLocal,
65
+ SplitStrings,
66
+ # Connection functions
67
+ CreateTheConnectionLocal,
68
+ CreateConnection,
69
+ CreateConnectionBetweenTwoConceptsLocal,
70
+ )
71
+
72
+ # Transaction support
73
+ from ccs.services.transaction import LocalTransaction
74
+
75
+ __version__ = "0.1.0"
76
+ __author__ = "Your Name"
77
+
78
+ __all__ = [
79
+ "__version__",
80
+ "__author__",
81
+ # Initialization
82
+ "init",
83
+ "updateAccessToken",
84
+ "isInitialized",
85
+ "getConfig",
86
+ # Configuration
87
+ "BaseUrl",
88
+ "TokenStorage",
89
+ # Legacy
90
+ "example_function",
91
+ "ExampleClass",
92
+ "helper_function",
93
+ # Models
94
+ "Concept",
95
+ "create_default_concept",
96
+ "Connection",
97
+ "create_default_connection",
98
+ # Data storage
99
+ "LocalConceptsData",
100
+ "LocalConnectionData",
101
+ "LocalSyncData",
102
+ "LocalId",
103
+ "InnerActions",
104
+ # Local services - Concepts
105
+ "CreateTheConceptLocal",
106
+ "MakeTheConceptLocal",
107
+ "MakeTheTypeConceptLocal",
108
+ "MakeTheInstanceConceptLocal",
109
+ "GetConceptByCharacterAndCategoryLocal",
110
+ "SplitStrings",
111
+ # Local services - Connections
112
+ "CreateTheConnectionLocal",
113
+ "CreateConnection",
114
+ "CreateConnectionBetweenTwoConceptsLocal",
115
+ # Transaction
116
+ "LocalTransaction",
117
+ ]
@@ -0,0 +1,11 @@
1
+ """
2
+ Configuration classes for the CCS library.
3
+ """
4
+
5
+ from ccs.config.base_url import BaseUrl
6
+ from ccs.config.token_storage import TokenStorage
7
+
8
+ __all__ = [
9
+ "BaseUrl",
10
+ "TokenStorage",
11
+ ]