aracnid-core 0.1.3__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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Jason Romano
|
|
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
|
|
13
|
+
all 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
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: aracnid-core
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Base interfaces for Aracnid integration connectors
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: abstract,connector
|
|
7
|
+
Author: Jason Romano
|
|
8
|
+
Author-email: aracnid@gmail.com
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Project-URL: Repository, https://github.com/aracnid/aracnid-core
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# Aracnid Core
|
|
20
|
+
|
|
21
|
+
This package provides abstract interfaces and shared types for building Aracnid-compatible data connectors.
|
|
22
|
+
|
|
23
|
+
## Getting Started
|
|
24
|
+
|
|
25
|
+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
|
|
26
|
+
|
|
27
|
+
### Prerequisites
|
|
28
|
+
|
|
29
|
+
This package supports the following version of Python:
|
|
30
|
+
|
|
31
|
+
- Python 3.10 or later
|
|
32
|
+
|
|
33
|
+
### Installing
|
|
34
|
+
|
|
35
|
+
Install the latest package using pip. (We prefer poetry.)
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
$ poetry install aracnid-core
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Running the tests
|
|
42
|
+
|
|
43
|
+
Explain how to run the automated tests for this system
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
$ python -m pytest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
TODO
|
|
52
|
+
|
|
53
|
+
## Authors
|
|
54
|
+
|
|
55
|
+
- **Jason Romano** - [Aracnid](https://github.com/aracnid)
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
|
|
60
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Aracnid Core
|
|
2
|
+
|
|
3
|
+
This package provides abstract interfaces and shared types for building Aracnid-compatible data connectors.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
|
|
8
|
+
|
|
9
|
+
### Prerequisites
|
|
10
|
+
|
|
11
|
+
This package supports the following version of Python:
|
|
12
|
+
|
|
13
|
+
- Python 3.10 or later
|
|
14
|
+
|
|
15
|
+
### Installing
|
|
16
|
+
|
|
17
|
+
Install the latest package using pip. (We prefer poetry.)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
$ poetry install aracnid-core
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Running the tests
|
|
24
|
+
|
|
25
|
+
Explain how to run the automated tests for this system
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
$ python -m pytest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
TODO
|
|
34
|
+
|
|
35
|
+
## Authors
|
|
36
|
+
|
|
37
|
+
- **Jason Romano** - [Aracnid](https://github.com/aracnid)
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
|
|
41
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any, Dict, List, Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class BaseConnector(ABC):
|
|
6
|
+
'''Abstract base class for CRUD operations across data sources.'''
|
|
7
|
+
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def create(self, record: Dict) -> Dict:
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
@abstractmethod
|
|
13
|
+
def read_one(self, record_id: str) -> Optional[Dict]:
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
def read_many(self, filters: Optional[Dict] = None) -> List[Dict]:
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
@abstractmethod
|
|
21
|
+
def update(self, record_id: str, changes: Dict) -> Dict:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
@abstractmethod
|
|
25
|
+
def replace(self, record_id: str, new_record: Dict) -> Dict:
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def delete_one(self, record_id: str, hard: bool = False) -> bool:
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
@abstractmethod
|
|
33
|
+
def delete_many(self, filters: Optional[Dict] = None, hard: bool = False) -> int:
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
@abstractmethod
|
|
37
|
+
def get_source_name(self) -> str:
|
|
38
|
+
pass
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "aracnid-core"
|
|
3
|
+
version = "0.1.3"
|
|
4
|
+
description = "Base interfaces for Aracnid integration connectors"
|
|
5
|
+
authors = ["Jason Romano <aracnid@gmail.com>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
repository = "https://github.com/aracnid/aracnid-core"
|
|
9
|
+
keywords = ["abstract", "connector"]
|
|
10
|
+
packages = [{include = "aracnid_core"}]
|
|
11
|
+
|
|
12
|
+
[tool.poetry.dependencies]
|
|
13
|
+
python = "^3.10"
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["poetry-core"]
|
|
17
|
+
build-backend = "poetry.core.masonry.api"
|